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 546730 - gtk_status_icon_get_gicon() should use a return instead of an ouput parameter
gtk_status_icon_get_gicon() should use a return instead of an ouput parameter
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.13.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2008-08-07 07:59 UTC by Murray Cumming
Modified: 2008-08-12 07:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] Fix for GIcon getters in GtkStatusIcon and GtkImage (4.59 KB, patch)
2008-08-07 10:40 UTC, Emmanuele Bassi (:ebassi)
none Details | Review

Description Murray Cumming 2008-08-07 07:59:25 UTC
I don't understand why the new gtk_status_icon_get_gicon() is using an output parameter. That's unnecessarily awkward. It should just be a return, like similar functions in GTK+. 

void
gtk_status_icon_get_gicon (GtkStatusIcon  *status_icon,
                           GIcon         **icon)
Comment 1 Christian Dywan 2008-08-07 08:20:19 UTC
For comparison, other GIcon* accessors:

void       gtk_image_get_gicon     (GtkImage              *image,
				    GIcon                **gicon,
				    GtkIconSize           *size);

GIcon*     gtk_icon_entry_get_gicon               (const GtkIconEntry *entry,
						   GtkIconEntryPosition icon_pos);
Comment 2 Murray Cumming 2008-08-07 09:05:51 UTC
Yes, it would be nice if gtk_image_get_gicon() was fixed too.
Comment 3 Emmanuele Bassi (:ebassi) 2008-08-07 10:40:27 UTC
Created attachment 116047 [details] [review]
[PATCH] Fix for GIcon getters in GtkStatusIcon and GtkImage

this patch changes the GIcon getters for GtkStatusIcon and GtkImage and makes them return the GIcon object instead of using a return location.
Comment 4 Matthias Clasen 2008-08-07 17:45:04 UTC
The GtkImage getter follows the pattern of all the other GtkImage image content getters. I don't see what we win by breaking that.
Comment 5 Murray Cumming 2008-08-08 07:25:56 UTC
(In reply to comment #4)
> The GtkImage getter follows the pattern of all the other GtkImage image content
> getters. I don't see what we win by breaking that.

OK, yes, that is true for all functions that return two items of data, such as gtk_image_get_gicon(). I wish it wasn't, of course.

So can we just fix gtk_status_icon_get_gicon()?

Comment 6 Matthias Clasen 2008-08-12 07:25:42 UTC
2008-08-12  Matthias Clasen  <mclasen@redhat.com>

        Bug 546730 – gtk_status_icon_get_gicon() should use a return instead
        of an ouput parameter

        * gtk/gtkstatusicon.[hc]: Change gtk_status_icon_get_gicon to
        return the GIcon directly.
        Complaint by Murray Cumming