mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
introspection: use (nullable) or (optional) instead of (allow-none)
If we have an input parameter (or return value) we need to use (nullable). However, if it is an (inout) or (out) parameter, (optional) is sufficient. It looks like (nullable) could be used for everything according to the Annotation documentation, but (optional) is more specific.
This commit is contained in:
54
gio/gmenu.c
54
gio/gmenu.c
@@ -253,8 +253,8 @@ g_menu_new (void)
|
||||
* g_menu_insert:
|
||||
* @menu: a #GMenu
|
||||
* @position: the position at which to insert the item
|
||||
* @label: (allow-none): the section label, or %NULL
|
||||
* @detailed_action: (allow-none): the detailed action string, or %NULL
|
||||
* @label: (nullable): the section label, or %NULL
|
||||
* @detailed_action: (nullable): the detailed action string, or %NULL
|
||||
*
|
||||
* Convenience function for inserting a normal menu item into @menu.
|
||||
* Combine g_menu_item_new() and g_menu_insert_item() for a more flexible
|
||||
@@ -278,8 +278,8 @@ g_menu_insert (GMenu *menu,
|
||||
/**
|
||||
* g_menu_prepend:
|
||||
* @menu: a #GMenu
|
||||
* @label: (allow-none): the section label, or %NULL
|
||||
* @detailed_action: (allow-none): the detailed action string, or %NULL
|
||||
* @label: (nullable): the section label, or %NULL
|
||||
* @detailed_action: (nullable): the detailed action string, or %NULL
|
||||
*
|
||||
* Convenience function for prepending a normal menu item to the start
|
||||
* of @menu. Combine g_menu_item_new() and g_menu_insert_item() for a more
|
||||
@@ -298,8 +298,8 @@ g_menu_prepend (GMenu *menu,
|
||||
/**
|
||||
* g_menu_append:
|
||||
* @menu: a #GMenu
|
||||
* @label: (allow-none): the section label, or %NULL
|
||||
* @detailed_action: (allow-none): the detailed action string, or %NULL
|
||||
* @label: (nullable): the section label, or %NULL
|
||||
* @detailed_action: (nullable): the detailed action string, or %NULL
|
||||
*
|
||||
* Convenience function for appending a normal menu item to the end of
|
||||
* @menu. Combine g_menu_item_new() and g_menu_insert_item() for a more
|
||||
@@ -319,7 +319,7 @@ g_menu_append (GMenu *menu,
|
||||
* g_menu_insert_section:
|
||||
* @menu: a #GMenu
|
||||
* @position: the position at which to insert the item
|
||||
* @label: (allow-none): the section label, or %NULL
|
||||
* @label: (nullable): the section label, or %NULL
|
||||
* @section: a #GMenuModel with the items of the section
|
||||
*
|
||||
* Convenience function for inserting a section menu item into @menu.
|
||||
@@ -345,7 +345,7 @@ g_menu_insert_section (GMenu *menu,
|
||||
/**
|
||||
* g_menu_prepend_section:
|
||||
* @menu: a #GMenu
|
||||
* @label: (allow-none): the section label, or %NULL
|
||||
* @label: (nullable): the section label, or %NULL
|
||||
* @section: a #GMenuModel with the items of the section
|
||||
*
|
||||
* Convenience function for prepending a section menu item to the start
|
||||
@@ -365,7 +365,7 @@ g_menu_prepend_section (GMenu *menu,
|
||||
/**
|
||||
* g_menu_append_section:
|
||||
* @menu: a #GMenu
|
||||
* @label: (allow-none): the section label, or %NULL
|
||||
* @label: (nullable): the section label, or %NULL
|
||||
* @section: a #GMenuModel with the items of the section
|
||||
*
|
||||
* Convenience function for appending a section menu item to the end of
|
||||
@@ -386,7 +386,7 @@ g_menu_append_section (GMenu *menu,
|
||||
* g_menu_insert_submenu:
|
||||
* @menu: a #GMenu
|
||||
* @position: the position at which to insert the item
|
||||
* @label: (allow-none): the section label, or %NULL
|
||||
* @label: (nullable): the section label, or %NULL
|
||||
* @submenu: a #GMenuModel with the items of the submenu
|
||||
*
|
||||
* Convenience function for inserting a submenu menu item into @menu.
|
||||
@@ -411,7 +411,7 @@ g_menu_insert_submenu (GMenu *menu,
|
||||
/**
|
||||
* g_menu_prepend_submenu:
|
||||
* @menu: a #GMenu
|
||||
* @label: (allow-none): the section label, or %NULL
|
||||
* @label: (nullable): the section label, or %NULL
|
||||
* @submenu: a #GMenuModel with the items of the submenu
|
||||
*
|
||||
* Convenience function for prepending a submenu menu item to the start
|
||||
@@ -431,7 +431,7 @@ g_menu_prepend_submenu (GMenu *menu,
|
||||
/**
|
||||
* g_menu_append_submenu:
|
||||
* @menu: a #GMenu
|
||||
* @label: (allow-none): the section label, or %NULL
|
||||
* @label: (nullable): the section label, or %NULL
|
||||
* @submenu: a #GMenuModel with the items of the submenu
|
||||
*
|
||||
* Convenience function for appending a submenu menu item to the end of
|
||||
@@ -643,7 +643,7 @@ valid_attribute_name (const gchar *name)
|
||||
* g_menu_item_set_attribute_value:
|
||||
* @menu_item: a #GMenuItem
|
||||
* @attribute: the attribute to set
|
||||
* @value: (allow-none): a #GVariant to use as the value, or %NULL
|
||||
* @value: (nullable): a #GVariant to use as the value, or %NULL
|
||||
*
|
||||
* Sets or unsets an attribute on @menu_item.
|
||||
*
|
||||
@@ -688,7 +688,7 @@ g_menu_item_set_attribute_value (GMenuItem *menu_item,
|
||||
* g_menu_item_set_attribute:
|
||||
* @menu_item: a #GMenuItem
|
||||
* @attribute: the attribute to set
|
||||
* @format_string: (allow-none): a #GVariant format string, or %NULL
|
||||
* @format_string: (nullable): a #GVariant format string, or %NULL
|
||||
* @...: positional parameters, as per @format_string
|
||||
*
|
||||
* Sets or unsets an attribute on @menu_item.
|
||||
@@ -737,7 +737,7 @@ g_menu_item_set_attribute (GMenuItem *menu_item,
|
||||
* g_menu_item_set_link:
|
||||
* @menu_item: a #GMenuItem
|
||||
* @link: type of link to establish or unset
|
||||
* @model: (allow-none): the #GMenuModel to link to (or %NULL to unset)
|
||||
* @model: (nullable): the #GMenuModel to link to (or %NULL to unset)
|
||||
*
|
||||
* Creates a link from @menu_item to @model if non-%NULL, or unsets it.
|
||||
*
|
||||
@@ -773,7 +773,7 @@ g_menu_item_set_link (GMenuItem *menu_item,
|
||||
* g_menu_item_get_attribute_value:
|
||||
* @menu_item: a #GMenuItem
|
||||
* @attribute: the attribute name to query
|
||||
* @expected_type: (allow-none): the expected type of the attribute
|
||||
* @expected_type: (nullable): the expected type of the attribute
|
||||
*
|
||||
* Queries the named @attribute on @menu_item.
|
||||
*
|
||||
@@ -890,7 +890,7 @@ g_menu_item_get_link (GMenuItem *menu_item,
|
||||
/**
|
||||
* g_menu_item_set_label:
|
||||
* @menu_item: a #GMenuItem
|
||||
* @label: (allow-none): the label to set, or %NULL to unset
|
||||
* @label: (nullable): the label to set, or %NULL to unset
|
||||
*
|
||||
* Sets or unsets the "label" attribute of @menu_item.
|
||||
*
|
||||
@@ -916,7 +916,7 @@ g_menu_item_set_label (GMenuItem *menu_item,
|
||||
/**
|
||||
* g_menu_item_set_submenu:
|
||||
* @menu_item: a #GMenuItem
|
||||
* @submenu: (allow-none): a #GMenuModel, or %NULL
|
||||
* @submenu: (nullable): a #GMenuModel, or %NULL
|
||||
*
|
||||
* Sets or unsets the "submenu" link of @menu_item to @submenu.
|
||||
*
|
||||
@@ -938,7 +938,7 @@ g_menu_item_set_submenu (GMenuItem *menu_item,
|
||||
/**
|
||||
* g_menu_item_set_section:
|
||||
* @menu_item: a #GMenuItem
|
||||
* @section: (allow-none): a #GMenuModel, or %NULL
|
||||
* @section: (nullable): a #GMenuModel, or %NULL
|
||||
*
|
||||
* Sets or unsets the "section" link of @menu_item to @section.
|
||||
*
|
||||
@@ -960,8 +960,8 @@ g_menu_item_set_section (GMenuItem *menu_item,
|
||||
/**
|
||||
* g_menu_item_set_action_and_target_value:
|
||||
* @menu_item: a #GMenuItem
|
||||
* @action: (allow-none): the name of the action for this item
|
||||
* @target_value: (allow-none): a #GVariant to use as the action target
|
||||
* @action: (nullable): the name of the action for this item
|
||||
* @target_value: (nullable): a #GVariant to use as the action target
|
||||
*
|
||||
* Sets or unsets the "action" and "target" attributes of @menu_item.
|
||||
*
|
||||
@@ -1026,8 +1026,8 @@ g_menu_item_set_action_and_target_value (GMenuItem *menu_item,
|
||||
/**
|
||||
* g_menu_item_set_action_and_target:
|
||||
* @menu_item: a #GMenuItem
|
||||
* @action: (allow-none): the name of the action for this item
|
||||
* @format_string: (allow-none): a GVariant format string
|
||||
* @action: (nullable): the name of the action for this item
|
||||
* @format_string: (nullable): a GVariant format string
|
||||
* @...: positional parameters, as per @format_string
|
||||
*
|
||||
* Sets or unsets the "action" and "target" attributes of @menu_item.
|
||||
@@ -1112,8 +1112,8 @@ g_menu_item_set_detailed_action (GMenuItem *menu_item,
|
||||
|
||||
/**
|
||||
* g_menu_item_new:
|
||||
* @label: (allow-none): the section label, or %NULL
|
||||
* @detailed_action: (allow-none): the detailed action string, or %NULL
|
||||
* @label: (nullable): the section label, or %NULL
|
||||
* @detailed_action: (nullable): the detailed action string, or %NULL
|
||||
*
|
||||
* Creates a new #GMenuItem.
|
||||
*
|
||||
@@ -1147,7 +1147,7 @@ g_menu_item_new (const gchar *label,
|
||||
|
||||
/**
|
||||
* g_menu_item_new_submenu:
|
||||
* @label: (allow-none): the section label, or %NULL
|
||||
* @label: (nullable): the section label, or %NULL
|
||||
* @submenu: a #GMenuModel with the items of the submenu
|
||||
*
|
||||
* Creates a new #GMenuItem representing a submenu.
|
||||
@@ -1177,7 +1177,7 @@ g_menu_item_new_submenu (const gchar *label,
|
||||
|
||||
/**
|
||||
* g_menu_item_new_section:
|
||||
* @label: (allow-none): the section label, or %NULL
|
||||
* @label: (nullable): the section label, or %NULL
|
||||
* @section: a #GMenuModel with the items of the section
|
||||
*
|
||||
* Creates a new #GMenuItem representing a section.
|
||||
|
Reference in New Issue
Block a user