GNOME Bugzilla – Bug 546132
GFileIcon is bindings-unfriendly
Last modified: 2008-08-07 19:45:54 UTC
GFileIcon is dependent on 'file' which is logically a property, but is not in the implementation. As a result, it cannot be properly subclassed (g_file_icon_new() binds together a fixed GType and functionality that cannot be done from outside: assigning to 'file'). 'file' should be made a construct-only readable property.
Agreed. A patch to add such a property would be happily accepted.
Created attachment 115848 [details] [review] patch implementing the proposed property
Comment on attachment 115848 [details] [review] patch implementing the proposed property >+ /** >+ * GFileIcon:file: >+ * >+ * The file containing icon image. >+ */ >+ g_object_class_install_property (gobject_class, PROP_FILE, >+ g_param_spec_object ("file", >+ _("file"), >+ _("The file containing icon image"), >+ G_TYPE_FILE, >+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB | G_PARAM_STATIC_NICK)); Just a small nitpick, "The file containing icon image" sounds awkward. I suggest "The file containing the icon".
I changed the wording as you suggested. Not a native speaker, so I sometimes make such mistakes. Sending gio/ChangeLog Sending gio/gfileicon.c Transmitting file data .. Committed revision 7318. 2008-08-07 Paul Pogonyshev <pogonyshev@gmx.net> * gfileicon.c (g_file_icon_get_property) (g_file_icon_set_property): New functions. (g_file_icon_class_init): Hook them up. Install `GFileIcon:file' property. (g_file_icon_new): Use the property (bug #546132).