After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 687059 - icon-theme: support loading symbolic GFileIcons from generic URIs
icon-theme: support loading symbolic GFileIcons from generic URIs
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-10-28 19:09 UTC by Cosimo Cecchi
Modified: 2012-10-31 15:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
icon-theme: support loading symbolic GFileIcons from generic URIs (8.23 KB, patch)
2012-10-28 19:09 UTC, Cosimo Cecchi
committed Details | Review

Description Cosimo Cecchi 2012-10-28 19:09:12 UTC
See attached patch
Comment 1 Cosimo Cecchi 2012-10-28 19:09:13 UTC
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.
Comment 2 Matthias Clasen 2012-10-29 01:16:57 UTC
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 ?
Comment 3 Cosimo Cecchi 2012-10-29 10:35:44 UTC
(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.
Comment 4 Cosimo Cecchi 2012-10-31 15:54:40 UTC
Attachment 227472 [details] pushed as 86ecf54 - icon-theme: support loading symbolic GFileIcons from generic URIs

Pushed to master