diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2015-02-22 17:49:55 -0800 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2015-02-23 09:56:06 -0800 |
commit | acd72ffabe88ae4078e1cc1c4c2377c6ea5aac5c (patch) | |
tree | 55c6beb2cef9d2d38200d8e350974f0360a131b5 /gtk/gtkicontheme.c | |
parent | e7a2fc2d0184bb7e5b37c61c9787b6ae64efb532 (diff) | |
download | gtk+-acd72ffabe88ae4078e1cc1c4c2377c6ea5aac5c.tar.gz |
icontheme: fill correct information when loading GResource-backed GIcons
When loading a GResource-backed GFileIcon into a GtkIconInfo we
currently fail to populate the is_resource private field.
Also, since is_svg is set by looking at the filename, and
g_file_get_path() returns NULL for a GResourceFile, is_svg was always
FALSE.
https://bugzilla.gnome.org/show_bug.cgi?id=744991
Diffstat (limited to 'gtk/gtkicontheme.c')
-rw-r--r-- | gtk/gtkicontheme.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index dc82b4501c..2f45f63ce1 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -5451,7 +5451,21 @@ gtk_icon_theme_lookup_by_gicon_for_scale (GtkIconTheme *icon_theme, if (file != NULL) { info->icon_file = g_object_ref (file); - info->filename = g_file_get_path (file); + info->is_resource = g_file_has_uri_scheme (file, "resource"); + + if (info->is_resource) + { + gchar *uri; + + uri = g_file_get_uri (file); + info->filename = g_strdup (uri + 11); /* resource:// */ + g_free (uri); + } + else + { + info->filename = g_file_get_path (file); + } + info->is_svg = suffix_from_name (info->filename) == ICON_SUFFIX_SVG; } } |