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 546132 - GFileIcon is bindings-unfriendly
GFileIcon is bindings-unfriendly
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other All
: Normal minor
: ---
Assigned To: Alexander Larsson
gtkdev
Depends on:
Blocks:
 
 
Reported: 2008-08-03 20:16 UTC by Paul Pogonyshev
Modified: 2008-08-07 19:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch implementing the proposed property (2.93 KB, patch)
2008-08-04 19:23 UTC, Paul Pogonyshev
committed Details | Review

Description Paul Pogonyshev 2008-08-03 20:16:28 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.
Comment 1 Matthias Clasen 2008-08-03 21:56:16 UTC
Agreed. A patch to add such a property would be happily accepted.
Comment 2 Paul Pogonyshev 2008-08-04 19:23:41 UTC
Created attachment 115848 [details] [review]
patch implementing the proposed property
Comment 3 Christian Dywan 2008-08-07 16:53:26 UTC
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".
Comment 4 Paul Pogonyshev 2008-08-07 19:45:54 UTC
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).