From a77162ebaf001beb15a7db658c40a538497bdf33 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 27 Oct 2011 19:03:11 +0100 Subject: [PATCH] radiotoolbutton: Fix the introspection annotations Everything that deals with a group has to be fixed. Plus, we have NULL checks without allowing NULL arguments; since NULL arguments are perfectly fine, we can relax the argument checks. https://bugzilla.gnome.org/show_bug.cgi?id=662870 --- gtk/gtkradiotoolbutton.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/gtk/gtkradiotoolbutton.c b/gtk/gtkradiotoolbutton.c index c1db17fc6..75fbcd2d3 100644 --- a/gtk/gtkradiotoolbutton.c +++ b/gtk/gtkradiotoolbutton.c @@ -129,7 +129,8 @@ gtk_radio_tool_button_set_property (GObject *object, /** * gtk_radio_tool_button_new: - * @group: (allow-none): An existing radio button group, or %NULL if you are creating a new group + * @group: (allow-none) (transfer none) (element-type GtkRadioButton): An + * existing radio button group, or %NULL if you are creating a new group * * Creates a new #GtkRadioToolButton, adding it to @group. * @@ -152,7 +153,8 @@ gtk_radio_tool_button_new (GSList *group) /** * gtk_radio_tool_button_new_from_stock: - * @group: (allow-none): an existing radio button group, or %NULL if you are creating a new group + * @group: (allow-none): an existing radio button group, or %NULL if you are + * creating a new group * @stock_id: the name of a stock item * * Creates a new #GtkRadioToolButton, adding it to @group. @@ -183,7 +185,7 @@ gtk_radio_tool_button_new_from_stock (GSList *group, /** * gtk_radio_tool_button_new_from_widget: - * @group: An existing #GtkRadioToolButton + * @group: (allow-none): An existing #GtkRadioToolButton, or %NULL * * Creates a new #GtkRadioToolButton adding it to the same group as @gruup * @@ -196,9 +198,9 @@ gtk_radio_tool_button_new_from_widget (GtkRadioToolButton *group) { GSList *list = NULL; - g_return_val_if_fail (GTK_IS_RADIO_TOOL_BUTTON (group), NULL); + g_return_val_if_fail (group == NULL || GTK_IS_RADIO_TOOL_BUTTON (group), NULL); - if (group) + if (group != NULL) list = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (group)); return gtk_radio_tool_button_new (list); @@ -206,7 +208,7 @@ gtk_radio_tool_button_new_from_widget (GtkRadioToolButton *group) /** * gtk_radio_tool_button_new_with_stock_from_widget: - * @group: An existing #GtkRadioToolButton. + * @group: (allow-none): An existing #GtkRadioToolButton. * @stock_id: the name of a stock item * * Creates a new #GtkRadioToolButton adding it to the same group as @group. @@ -223,9 +225,9 @@ gtk_radio_tool_button_new_with_stock_from_widget (GtkRadioToolButton *group, { GSList *list = NULL; - g_return_val_if_fail (GTK_IS_RADIO_TOOL_BUTTON (group), NULL); + g_return_val_if_fail (group == NULL || GTK_IS_RADIO_TOOL_BUTTON (group), NULL); - if (group) + if (group != NULL) list = gtk_radio_tool_button_get_group (group); return gtk_radio_tool_button_new_from_stock (list, stock_id); @@ -258,7 +260,7 @@ gtk_radio_tool_button_get_group (GtkRadioToolButton *button) /** * gtk_radio_tool_button_set_group: * @button: a #GtkRadioToolButton - * @group: an existing radio button group + * @group: (transfer none) (element-type GtkRadioButton): an existing radio button group * * Adds @button to @group, removing it from the group it belonged to before. * -- 2.43.2