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:
Christian Hergert
2016-10-28 18:29:02 -07:00
parent a4012abbdf
commit 18a33f72db
151 changed files with 986 additions and 987 deletions

View File

@@ -1767,7 +1767,7 @@ find_file_in_data_dirs (const gchar *file,
* g_bookmark_file_load_from_data_dirs:
* @bookmark: a #GBookmarkFile
* @file: (type filename): a relative path to a filename to open and parse
* @full_path: (type filename) (allow-none): return location for a string
* @full_path: (type filename) (nullable): return location for a string
* containing the full path of the file, or %NULL
* @error: return location for a #GError, or %NULL
*
@@ -1848,7 +1848,7 @@ g_bookmark_file_load_from_data_dirs (GBookmarkFile *bookmark,
/**
* g_bookmark_file_to_data:
* @bookmark: a #GBookmarkFile
* @length: (allow-none) (out): return location for the length of the returned string, or %NULL
* @length: (out) (optional): return location for the length of the returned string, or %NULL
* @error: return location for a #GError, or %NULL
*
* This function outputs @bookmark as a string.
@@ -2038,7 +2038,7 @@ g_bookmark_file_has_item (GBookmarkFile *bookmark,
/**
* g_bookmark_file_get_uris:
* @bookmark: a #GBookmarkFile
* @length: (allow-none) (out): return location for the number of returned URIs, or %NULL
* @length: (out) (optional): return location for the number of returned URIs, or %NULL
*
* Returns all URIs of the bookmarks in the bookmark file @bookmark.
* The array of returned URIs will be %NULL-terminated, so @length may
@@ -2082,7 +2082,7 @@ g_bookmark_file_get_uris (GBookmarkFile *bookmark,
/**
* g_bookmark_file_set_title:
* @bookmark: a #GBookmarkFile
* @uri: (allow-none): a valid URI or %NULL
* @uri: (nullable): a valid URI or %NULL
* @title: a UTF-8 encoded string
*
* Sets @title as the title of the bookmark for @uri inside the
@@ -2127,7 +2127,7 @@ g_bookmark_file_set_title (GBookmarkFile *bookmark,
/**
* g_bookmark_file_get_title:
* @bookmark: a #GBookmarkFile
* @uri: (allow-none): a valid URI or %NULL
* @uri: (nullable): a valid URI or %NULL
* @error: return location for a #GError, or %NULL
*
* Returns the title of the bookmark for @uri.
@@ -2170,7 +2170,7 @@ g_bookmark_file_get_title (GBookmarkFile *bookmark,
/**
* g_bookmark_file_set_description:
* @bookmark: a #GBookmarkFile
* @uri: (allow-none): a valid URI or %NULL
* @uri: (nullable): a valid URI or %NULL
* @description: a string
*
* Sets @description as the description of the bookmark for @uri.
@@ -2823,7 +2823,7 @@ g_bookmark_file_remove_group (GBookmarkFile *bookmark,
* g_bookmark_file_set_groups:
* @bookmark: a #GBookmarkFile
* @uri: an item's URI
* @groups: (allow-none): an array of group names, or %NULL to remove all groups
* @groups: (nullable): an array of group names, or %NULL to remove all groups
* @length: number of group name values in @groups
*
* Sets a list of group names for the item with URI @uri. Each previously
@@ -2873,7 +2873,7 @@ g_bookmark_file_set_groups (GBookmarkFile *bookmark,
* g_bookmark_file_get_groups:
* @bookmark: a #GBookmarkFile
* @uri: a valid URI
* @length: (allow-none) (out): return location for the length of the returned string, or %NULL
* @length: (out) (optional): return location for the length of the returned string, or %NULL
* @error: return location for a #GError, or %NULL
*
* Retrieves the list of group names of the bookmark for @uri.
@@ -2945,9 +2945,9 @@ g_bookmark_file_get_groups (GBookmarkFile *bookmark,
* g_bookmark_file_add_application:
* @bookmark: a #GBookmarkFile
* @uri: a valid URI
* @name: (allow-none): the name of the application registering the bookmark
* @name: (nullable): the name of the application registering the bookmark
* or %NULL
* @exec: (allow-none): command line to be used to launch the bookmark or %NULL
* @exec: (nullable): command line to be used to launch the bookmark or %NULL
*
* Adds the application with @name and @exec to the list of
* applications that have registered a bookmark for @uri into
@@ -3298,9 +3298,9 @@ expand_exec_line (const gchar *exec_fmt,
* @bookmark: a #GBookmarkFile
* @uri: a valid URI
* @name: an application's name
* @exec: (allow-none) (out): return location for the command line of the application, or %NULL
* @count: (allow-none) (out): return location for the registration count, or %NULL
* @stamp: (allow-none) (out): return location for the last registration time, or %NULL
* @exec: (out) (optional): return location for the command line of the application, or %NULL
* @count: (out) (optional): return location for the registration count, or %NULL
* @stamp: (out) (optional): return location for the last registration time, or %NULL
* @error: return location for a #GError, or %NULL
*
* Gets the registration informations of @app_name for the bookmark for
@@ -3398,7 +3398,7 @@ g_bookmark_file_get_app_info (GBookmarkFile *bookmark,
* g_bookmark_file_get_applications:
* @bookmark: a #GBookmarkFile
* @uri: a valid URI
* @length: (allow-none) (out): return location of the length of the returned list, or %NULL
* @length: (out) (optional): return location of the length of the returned list, or %NULL
* @error: return location for a #GError, or %NULL
*
* Retrieves the names of the applications that have registered the
@@ -3490,7 +3490,7 @@ g_bookmark_file_get_size (GBookmarkFile *bookmark)
* g_bookmark_file_move_item:
* @bookmark: a #GBookmarkFile
* @old_uri: a valid URI
* @new_uri: (allow-none): a valid URI, or %NULL
* @new_uri: (nullable): a valid URI, or %NULL
* @error: return location for a #GError or %NULL
*
* Changes the URI of a bookmark item from @old_uri to @new_uri. Any
@@ -3556,7 +3556,7 @@ g_bookmark_file_move_item (GBookmarkFile *bookmark,
* g_bookmark_file_set_icon:
* @bookmark: a #GBookmarkFile
* @uri: a valid URI
* @href: (allow-none): the URI of the icon for the bookmark, or %NULL
* @href: (nullable): the URI of the icon for the bookmark, or %NULL
* @mime_type: the MIME type of the icon for the bookmark
*
* Sets the icon for the bookmark for @uri. If @href is %NULL, unsets
@@ -3605,8 +3605,8 @@ g_bookmark_file_set_icon (GBookmarkFile *bookmark,
* g_bookmark_file_get_icon:
* @bookmark: a #GBookmarkFile
* @uri: a valid URI
* @href: (allow-none) (out): return location for the icon's location or %NULL
* @mime_type: (allow-none) (out): return location for the icon's MIME type or %NULL
* @href: (out) (optional): return location for the icon's location or %NULL
* @mime_type: (out) (optional): return location for the icon's MIME type or %NULL
* @error: return location for a #GError or %NULL
*
* Gets the icon of the bookmark for @uri.