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 679563 - Properly annotate the GtkRadio* widgets
Properly annotate the GtkRadio* widgets
Status: RESOLVED DUPLICATE of bug 671362
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-07-07 17:45 UTC by Torsten Schoenfeld
Modified: 2015-03-07 20:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Properly annotate the GtkRadio* widgets (6.76 KB, patch)
2012-07-07 17:45 UTC, Torsten Schoenfeld
none Details | Review
Properly annotate the GtkRadio* widgets (8.73 KB, patch)
2012-07-07 19:00 UTC, Torsten Schoenfeld
needs-work Details | Review
Allow NULLs (2.31 KB, patch)
2013-12-06 23:02 UTC, Torsten Schoenfeld
none Details | Review

Description Torsten Schoenfeld 2012-07-07 17:45:18 UTC
The attached patch adds (allow-none) and (transfer container) annotations to
the 'group' parameters of many methods of the GtkRadio* widgets.
Comment 1 Torsten Schoenfeld 2012-07-07 17:45:20 UTC
Created attachment 218227 [details] [review]
Properly annotate the GtkRadio* widgets

The group GSList parameters that the constructors and the set_group() methods
of GtkRadioAction, GtkRadioButton, GtkRadioMenuItem and GtkRadioToolButton
receive are always (allow-none) and (transfer container).
Comment 2 Torsten Schoenfeld 2012-07-07 19:00:36 UTC
Created attachment 218236 [details] [review]
Properly annotate the GtkRadio* widgets

The group GSList parameters that the constructors and the set_group() methods
of GtkRadioAction, GtkRadioButton, GtkRadioMenuItem and GtkRadioToolButton
receive are always (allow-none) and (transfer container).

Also, the "_from_widget" constructors of GtkRadioMenuItem should allow NULL for
the group member.  Otherwise, there is no way to construct an initial item with
the "_from_widget" constructors.
Comment 3 Torsten Schoenfeld 2012-08-17 22:00:36 UTC
Ping.
Comment 4 Cosimo Cecchi 2012-09-03 17:55:50 UTC
Review of attachment 218236 [details] [review]:

::: gtk/gtkradioaction.c
@@ +425,3 @@
  * @action: the action object
+ * @group: (element-type GtkRadioAction) (transfer container) (allow-none): a
+ *         list representing a radio group

As far as I can see, the (allow-none) annotations are all correct, but I don't think the (transfer container) changes are: setters are never expected to consume caller's input, so those functions should all be (transfer none).

You should also add an "or %NULL" snippet to the doc comment where it's missing.

::: gtk/gtkradiomenuitem.c
@@ -239,3 @@
 /**
  * gtk_radio_menu_item_new_with_label:
- * @group: (element-type GtkRadioMenuItem) (transfer full):

I think this (transfer full) annotation is just wrong.
Comment 5 Torsten Schoenfeld 2013-12-06 23:01:57 UTC
(In reply to comment #4)
> Review of attachment 218236 [details] [review]:
> 
> ::: gtk/gtkradioaction.c
> @@ +425,3 @@
>   * @action: the action object
> + * @group: (element-type GtkRadioAction) (transfer container) (allow-none): a
> + *         list representing a radio group
> 
> As far as I can see, the (allow-none) annotations are all correct, but I don't
> think the (transfer container) changes are: setters are never expected to
> consume caller's input, so those functions should all be (transfer none).

OK, I take back the "(transfer container)" proposal.  But do note that "(transfer none)" is not entirely correct either: the GtkRadio* widgets assume that whatever you pass in will be valid for their lifetime.  Under "(transfer none)", however, you should be allowed to free whatever you passed in; if gtkradio* wants to hang on to it, they should take a copy.

But for now, I simply avoid the GSList-based API in the bindings.  And I committed the non-controversial parts of the patch as 904bc272500b804e7868f7233883604d5778d133.

What remains are the following changes to GtkRadioMenuItem.
Comment 6 Torsten Schoenfeld 2013-12-06 23:02:43 UTC
Created attachment 263703 [details] [review]
Allow NULLs
Comment 7 Matthias Clasen 2015-03-07 20:12:02 UTC

*** This bug has been marked as a duplicate of bug 671362 ***