GNOME Bugzilla – Bug 687059
icon-theme: support loading symbolic GFileIcons from generic URIs
Last modified: 2012-10-31 15:54:44 UTC
See attached patch
Created attachment 227472 [details] [review] icon-theme: support loading symbolic GFileIcons from generic URIs Right now we support loading and recoloring symbolic GFileIcons, but only if the underlying GFile has a local path. This breaks when the GFileIcon is loaded from a GResource, which is a reasonable option for an application that wants to ship a custom symbolic icon. This patch changes GtkIconInfo to store a GFile together with the file path, and changes the symbolic icon lookup code to use the GFile URI, which transparently makes the code work also for GResources.
Review of attachment 227472 [details] [review]: ::: gtk/gtkicontheme.c @@ +203,3 @@ */ gchar *filename; + GFile *icon_file; I don't like to grow the struct - can we get rid of the filename altogether, here ?
(In reply to comment #2) > Review of attachment 227472 [details] [review]: > > ::: gtk/gtkicontheme.c > @@ +203,3 @@ > */ > gchar *filename; > + GFile *icon_file; > > I don't like to grow the struct - can we get rid of the filename altogether, > here ? I'm not the biggest fan of that either, but we return icon_info->filename (without copying it) as part of the public API (gtk_icon_info_get_filename()) and it's also used in a number of places internally to lookup and match icons from the theme, so I figured it would be cleaner to just use an additional field.
Attachment 227472 [details] pushed as 86ecf54 - icon-theme: support loading symbolic GFileIcons from generic URIs Pushed to master