mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-18 09:00:34 +00:00
icontheme: Use correct URI for icons in resource paths
Fix based on a patch by Stefano Faccini, https://bugzilla.gnome.org/show_bug.cgi?id=732894
This commit is contained in:
parent
b31a310d7d
commit
cd71a23ee2
@ -1759,6 +1759,7 @@ real_choose_icon (GtkIconTheme *icon_theme,
|
||||
|
||||
if (unthemed_icon)
|
||||
{
|
||||
gchar *uri;
|
||||
icon_info = icon_info_new (ICON_THEME_DIR_UNTHEMED, size, 1);
|
||||
|
||||
/* A SVG icon, when allowed, beats out a XPM icon, but not a PNG icon */
|
||||
@ -1770,9 +1771,14 @@ real_choose_icon (GtkIconTheme *icon_theme,
|
||||
else if (unthemed_icon->no_svg_filename)
|
||||
icon_info->filename = g_strdup (unthemed_icon->no_svg_filename);
|
||||
|
||||
icon_info->icon_file = g_file_new_for_path (icon_info->filename);
|
||||
if (unthemed_icon->is_resource)
|
||||
uri = g_strconcat ("resource://", icon_info->filename, NULL);
|
||||
else
|
||||
uri = g_strconcat ("file://", icon_info->filename, NULL);
|
||||
icon_info->icon_file = g_file_new_for_uri (uri);
|
||||
icon_info->is_svg = suffix_from_name (icon_info->filename) == ICON_SUFFIX_SVG;
|
||||
icon_info->is_resource = unthemed_icon->is_resource;
|
||||
g_free (uri);
|
||||
}
|
||||
|
||||
out:
|
||||
@ -3016,11 +3022,18 @@ theme_lookup_icon (IconTheme *theme,
|
||||
|
||||
if (min_dir->dir)
|
||||
{
|
||||
gchar *uri;
|
||||
|
||||
file = g_strconcat (icon_name, string_from_suffix (suffix), NULL);
|
||||
icon_info->filename = g_build_filename (min_dir->dir, file, NULL);
|
||||
icon_info->icon_file = g_file_new_for_path (icon_info->filename);
|
||||
if (min_dir->is_resource)
|
||||
uri = g_strconcat ("resource://", icon_info->filename, NULL);
|
||||
else
|
||||
uri = g_strconcat ("file://", icon_info->filename, NULL);
|
||||
icon_info->icon_file = g_file_new_for_uri (uri);
|
||||
icon_info->is_svg = suffix == ICON_SUFFIX_SVG;
|
||||
icon_info->is_resource = min_dir->is_resource;
|
||||
g_free (uri);
|
||||
g_free (file);
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user