diff options
author | Matthias Clasen <mclasen@redhat.com> | 2014-07-14 18:44:00 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-07-14 18:44:00 -0400 |
commit | 5a252f13a863c00ccd9901afa110e85836a6af4c (patch) | |
tree | b6ced4fb2b01455f863dd07aaef2b9ba2af0c92a /gtk/gtkicontheme.c | |
parent | 64c2bafafcf15f93a6417267878adcdd43b21e74 (diff) | |
download | gtk+-5a252f13a863c00ccd9901afa110e85836a6af4c.tar.gz |
GktIconTheme: Be more careful with paths
Slapping file:// in front of a path does not guarantee a working
uri (e.g. if you are on windows and the path looks like F:\\...).
Therefore, go back to using g_file_new_for_path if we don't have
to deal with a resource.
Diffstat (limited to 'gtk/gtkicontheme.c')
-rw-r--r-- | gtk/gtkicontheme.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index bf69dd891c..42cb138087 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -1759,7 +1759,6 @@ 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 */ @@ -1772,13 +1771,17 @@ real_choose_icon (GtkIconTheme *icon_theme, icon_info->filename = g_strdup (unthemed_icon->no_svg_filename); if (unthemed_icon->is_resource) - uri = g_strconcat ("resource://", icon_info->filename, NULL); + { + gchar *uri; + uri = g_strconcat ("resource://", icon_info->filename, NULL); + icon_info->icon_file = g_file_new_for_uri (uri); + g_free (uri); + } else - uri = g_strconcat ("file://", icon_info->filename, NULL); - icon_info->icon_file = g_file_new_for_uri (uri); + icon_info->icon_file = g_file_new_for_path (icon_info->filename); + 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: |