Merge branch 'gio-missing-nullable' into 'master'

gio: Add missing nullable annotations

See merge request GNOME/glib!1708
This commit is contained in:
Philip Withnall 2020-11-14 15:53:55 +00:00
commit 1c290acd74
42 changed files with 129 additions and 112 deletions

View File

@ -224,7 +224,7 @@ g_action_change_state (GAction *action,
* The return value (if non-%NULL) should be freed with
* g_variant_unref() when it is no longer required.
*
* Returns: (transfer full): the current state of the action
* Returns: (nullable) (transfer full): the current state of the action
*
* Since: 2.28
**/

View File

@ -76,7 +76,7 @@ g_action_map_default_init (GActionMapInterface *iface)
*
* If no such action exists, returns %NULL.
*
* Returns: (transfer none): a #GAction, or %NULL
* Returns: (nullable) (transfer none): a #GAction, or %NULL
*
* Since: 2.32
*/

View File

@ -173,7 +173,7 @@ g_app_info_equal (GAppInfo *appinfo1,
* Note that the returned ID may be %NULL, depending on how
* the @appinfo has been constructed.
*
* Returns: a string containing the application's ID.
* Returns: (nullable): a string containing the application's ID.
**/
const char *
g_app_info_get_id (GAppInfo *appinfo)
@ -240,7 +240,7 @@ g_app_info_get_display_name (GAppInfo *appinfo)
*
* Gets a human-readable description of an installed application.
*
* Returns: a string containing a description of the
* Returns: (nullable): a string containing a description of the
* application @appinfo, or %NULL if none.
**/
const char *
@ -284,7 +284,7 @@ g_app_info_get_executable (GAppInfo *appinfo)
* Gets the commandline with which the application will be
* started.
*
* Returns: (type filename): a string containing the @appinfo's commandline,
* Returns: (nullable) (type filename): a string containing the @appinfo's commandline,
* or %NULL if this information is not available
*
* Since: 2.20
@ -518,7 +518,7 @@ g_app_info_get_supported_types (GAppInfo *appinfo)
*
* Gets the icon for the application.
*
* Returns: (transfer none): the default #GIcon for @appinfo or %NULL
* Returns: (nullable) (transfer none): the default #GIcon for @appinfo or %NULL
* if there is no default icon.
**/
GIcon *
@ -1279,7 +1279,7 @@ g_app_launch_context_get_environment (GAppLaunchContext *context)
* applications are started on the same display as the launching
* application, by setting the `DISPLAY` environment variable.
*
* Returns: a display string for the display.
* Returns: (nullable): a display string for the display.
*/
char *
g_app_launch_context_get_display (GAppLaunchContext *context,
@ -1311,7 +1311,7 @@ g_app_launch_context_get_display (GAppLaunchContext *context,
* Startup notification IDs are defined in the
* [FreeDesktop.Org Startup Notifications standard](http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt).
*
* Returns: a startup notification ID for the application, or %NULL if
* Returns: (nullable): a startup notification ID for the application, or %NULL if
* not supported.
**/
char *

View File

@ -1793,7 +1793,7 @@ g_application_new (const gchar *application_id,
*
* Gets the unique identifier for @application.
*
* Returns: the identifier for @application, owned by @application
* Returns: (nullable): the identifier for @application, owned by @application
*
* Since: 2.28
**/
@ -2084,7 +2084,7 @@ g_application_get_is_remote (GApplication *application)
* This function must not be called before the application has been
* registered. See g_application_get_is_registered().
*
* Returns: (transfer none): a #GDBusConnection, or %NULL
* Returns: (nullable) (transfer none): a #GDBusConnection, or %NULL
*
* Since: 2.34
**/
@ -2116,7 +2116,7 @@ g_application_get_dbus_connection (GApplication *application)
* This function must not be called before the application has been
* registered. See g_application_get_is_registered().
*
* Returns: the object path, or %NULL
* Returns: (nullable): the object path, or %NULL
*
* Since: 2.34
**/
@ -2743,7 +2743,7 @@ static GApplication *default_app;
*
* If there is no default application then %NULL is returned.
*
* Returns: (transfer none): the default application for this process, or %NULL
* Returns: (nullable) (transfer none): the default application for this process, or %NULL
*
* Since: 2.32
**/

View File

@ -529,7 +529,7 @@ g_application_command_line_get_options_dict (GApplicationCommandLine *cmdline)
*
* You must only call this function once per commandline invocation.
*
* Returns: (transfer full): a #GInputStream for stdin
* Returns: (nullable) (transfer full): a #GInputStream for stdin
*
* Since: 2.34
**/
@ -610,7 +610,7 @@ g_application_command_line_get_environ (GApplicationCommandLine *cmdline)
* The return value should not be modified or freed and is valid for as
* long as @cmdline exists.
*
* Returns: the value of the variable, or %NULL if unset or unsent
* Returns: (nullable): the value of the variable, or %NULL if unset or unsent
*
* Since: 2.28
**/

View File

@ -165,7 +165,7 @@ g_bytes_icon_new (GBytes *bytes)
*
* Gets the #GBytes associated with the given @icon.
*
* Returns: (transfer none): a #GBytes, or %NULL.
* Returns: (transfer none): a #GBytes.
*
* Since: 2.38
**/

View File

@ -73,7 +73,7 @@ g_dbus_interface_get_info (GDBusInterface *interface_)
* the returned object is being used from other threads. See
* g_dbus_interface_dup_object() for a thread-safe alternative.
*
* Returns: (transfer none): A #GDBusObject or %NULL. The returned
* Returns: (nullable) (transfer none): A #GDBusObject or %NULL. The returned
* reference belongs to @interface_ and should not be freed.
*
* Since: 2.30
@ -91,7 +91,7 @@ g_dbus_interface_get_object (GDBusInterface *interface_)
*
* Gets the #GDBusObject that @interface_ belongs to, if any.
*
* Returns: (transfer full): A #GDBusObject or %NULL. The returned
* Returns: (nullable) (transfer full): A #GDBusObject or %NULL. The returned
* reference should be freed with g_object_unref().
*
* Since: 2.32

View File

@ -767,7 +767,7 @@ set_object_path_locked (GDBusInterfaceSkeleton *interface_,
*
* Gets the first connection that @interface_ is exported on, if any.
*
* Returns: (transfer none): A #GDBusConnection or %NULL if @interface_ is
* Returns: (nullable) (transfer none): A #GDBusConnection or %NULL if @interface_ is
* not exported anywhere. Do not free, the object belongs to @interface_.
*
* Since: 2.30
@ -876,7 +876,7 @@ g_dbus_interface_skeleton_has_connection (GDBusInterfaceSkeleton *interface_
*
* Gets the object path that @interface_ is exported on, if any.
*
* Returns: A string owned by @interface_ or %NULL if @interface_ is not exported
* Returns: (nullable): A string owned by @interface_ or %NULL if @interface_ is not exported
* anywhere. Do not free, the string belongs to @interface_.
*
* Since: 2.30

View File

@ -1847,7 +1847,7 @@ g_dbus_node_info_new_for_xml (const gchar *xml_data,
*
* The cost of this function is O(n) in number of annotations.
*
* Returns: The value or %NULL if not found. Do not free, it is owned by @annotations.
* Returns: (nullable): The value or %NULL if not found. Do not free, it is owned by @annotations.
*
* Since: 2.26
*/
@ -1915,7 +1915,7 @@ static GHashTable *info_cache = NULL;
* The cost of this function is O(n) in number of methods unless
* g_dbus_interface_info_cache_build() has been used on @info.
*
* Returns: (transfer none): A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
* Returns: (nullable) (transfer none): A #GDBusMethodInfo or %NULL if not found. Do not free, it is owned by @info.
*
* Since: 2.26
*/
@ -1969,7 +1969,7 @@ g_dbus_interface_info_lookup_method (GDBusInterfaceInfo *info,
* The cost of this function is O(n) in number of signals unless
* g_dbus_interface_info_cache_build() has been used on @info.
*
* Returns: (transfer none): A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
* Returns: (nullable) (transfer none): A #GDBusSignalInfo or %NULL if not found. Do not free, it is owned by @info.
*
* Since: 2.26
*/
@ -2023,7 +2023,7 @@ g_dbus_interface_info_lookup_signal (GDBusInterfaceInfo *info,
* The cost of this function is O(n) in number of properties unless
* g_dbus_interface_info_cache_build() has been used on @info.
*
* Returns: (transfer none): A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
* Returns: (nullable) (transfer none): A #GDBusPropertyInfo or %NULL if not found. Do not free, it is owned by @info.
*
* Since: 2.26
*/
@ -2165,7 +2165,7 @@ g_dbus_interface_info_cache_release (GDBusInterfaceInfo *info)
*
* The cost of this function is O(n) in number of interfaces.
*
* Returns: (transfer none): A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
* Returns: (nullable) (transfer none): A #GDBusInterfaceInfo or %NULL if not found. Do not free, it is owned by @info.
*
* Since: 2.26
*/

View File

@ -1085,7 +1085,7 @@ g_dbus_message_get_header_fields (GDBusMessage *message)
*
* Gets the body of a message.
*
* Returns: (transfer none): A #GVariant or %NULL if the body is
* Returns: (nullable) (transfer none): A #GVariant or %NULL if the body is
* empty. Do not free, it is owned by @message.
*
* Since: 2.26
@ -1164,7 +1164,7 @@ g_dbus_message_set_body (GDBusMessage *message,
* to the file descriptor that can be accessed by
* `g_unix_fd_list_get (list, 5, ...)`.
*
* Returns: (transfer none):A #GUnixFDList or %NULL if no file descriptors are
* Returns: (nullable) (transfer none): A #GUnixFDList or %NULL if no file descriptors are
* associated. Do not free, this object is owned by @message.
*
* Since: 2.26
@ -2994,7 +2994,7 @@ g_dbus_message_set_reply_serial (GDBusMessage *message,
*
* Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
*
* Returns: The value.
* Returns: (nullable): The value.
*
* Since: 2.26
*/
@ -3008,7 +3008,7 @@ g_dbus_message_get_interface (GDBusMessage *message)
/**
* g_dbus_message_set_interface:
* @message: A #GDBusMessage.
* @value: The value to set.
* @value: (nullable): The value to set.
*
* Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field.
*
@ -3031,7 +3031,7 @@ g_dbus_message_set_interface (GDBusMessage *message,
*
* Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
*
* Returns: The value.
* Returns: (nullable): The value.
*
* Since: 2.26
*/
@ -3045,7 +3045,7 @@ g_dbus_message_get_member (GDBusMessage *message)
/**
* g_dbus_message_set_member:
* @message: A #GDBusMessage.
* @value: The value to set.
* @value: (nullable): The value to set.
*
* Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field.
*
@ -3068,7 +3068,7 @@ g_dbus_message_set_member (GDBusMessage *message,
*
* Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
*
* Returns: The value.
* Returns: (nullable): The value.
*
* Since: 2.26
*/
@ -3082,7 +3082,7 @@ g_dbus_message_get_path (GDBusMessage *message)
/**
* g_dbus_message_set_path:
* @message: A #GDBusMessage.
* @value: The value to set.
* @value: (nullable): The value to set.
*
* Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field.
*
@ -3105,7 +3105,7 @@ g_dbus_message_set_path (GDBusMessage *message,
*
* Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
*
* Returns: The value.
* Returns: (nullable): The value.
*
* Since: 2.26
*/
@ -3119,7 +3119,7 @@ g_dbus_message_get_sender (GDBusMessage *message)
/**
* g_dbus_message_set_sender:
* @message: A #GDBusMessage.
* @value: The value to set.
* @value: (nullable): The value to set.
*
* Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field.
*
@ -3142,7 +3142,7 @@ g_dbus_message_set_sender (GDBusMessage *message,
*
* Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
*
* Returns: The value.
* Returns: (nullable): The value.
*
* Since: 2.26
*/
@ -3156,7 +3156,7 @@ g_dbus_message_get_destination (GDBusMessage *message)
/**
* g_dbus_message_set_destination:
* @message: A #GDBusMessage.
* @value: The value to set.
* @value: (nullable): The value to set.
*
* Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field.
*
@ -3179,7 +3179,7 @@ g_dbus_message_set_destination (GDBusMessage *message,
*
* Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
*
* Returns: The value.
* Returns: (nullable): The value.
*
* Since: 2.26
*/
@ -3192,7 +3192,7 @@ g_dbus_message_get_error_name (GDBusMessage *message)
/**
* g_dbus_message_set_error_name:
* @message: A #GDBusMessage.
* @message: (nullable): A #GDBusMessage.
* @value: The value to set.
*
* Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field.
@ -3234,7 +3234,7 @@ g_dbus_message_get_signature (GDBusMessage *message)
/**
* g_dbus_message_set_signature:
* @message: A #GDBusMessage.
* @value: The value to set.
* @value: (nullable): The value to set.
*
* Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field.
*
@ -3257,7 +3257,7 @@ g_dbus_message_set_signature (GDBusMessage *message,
*
* Convenience to get the first item in the body of @message.
*
* Returns: The string item or %NULL if the first item in the body of
* Returns: (nullable): The string item or %NULL if the first item in the body of
* @message is not a string.
*
* Since: 2.26

View File

@ -194,7 +194,7 @@ g_dbus_method_invocation_get_interface_name (GDBusMethodInvocation *invocation)
* returned. See g_dbus_method_invocation_get_property_info() and
* #GDBusInterfaceVTable for more information.
*
* Returns: A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
* Returns: (nullable): A #GDBusMethodInfo or %NULL. Do not free, it is owned by @invocation.
*
* Since: 2.26
*/
@ -221,7 +221,7 @@ g_dbus_method_invocation_get_method_info (GDBusMethodInvocation *invocation)
*
* If the call was GetAll, %NULL will be returned.
*
* Returns: (transfer none): a #GDBusPropertyInfo or %NULL
* Returns: (nullable) (transfer none): a #GDBusPropertyInfo or %NULL
*
* Since: 2.38
*/

View File

@ -137,7 +137,7 @@ g_dbus_object_get_interfaces (GDBusObject *object)
* Gets the D-Bus interface with name @interface_name associated with
* @object, if any.
*
* Returns: (transfer full): %NULL if not found, otherwise a
* Returns: (nullable) (transfer full): %NULL if not found, otherwise a
* #GDBusInterface that must be freed with g_object_unref().
*
* Since: 2.30

View File

@ -533,9 +533,9 @@ g_dbus_gvariant_to_gvalue (GVariant *value,
* See the g_dbus_gvariant_to_gvalue() function for how to convert a
* #GVariant to a #GValue.
*
* Returns: A #GVariant (never floating) of #GVariantType @type holding
* the data from @gvalue or %NULL in case of failure. Free with
* g_variant_unref().
* Returns: (transfer full): A #GVariant (never floating) of
* #GVariantType @type holding the data from @gvalue or an empty #GVariant
* in case of failure. Free with g_variant_unref().
*
* Since: 2.30
*/

View File

@ -2107,7 +2107,7 @@ g_desktop_app_info_get_is_hidden (GDesktopAppInfo *info)
* situations such as the #GDesktopAppInfo returned from
* g_desktop_app_info_new_from_keyfile(), this function will return %NULL.
*
* Returns: (type filename): The full path to the file for @info,
* Returns: (nullable) (type filename): The full path to the file for @info,
* or %NULL if not known.
* Since: 2.24
*/
@ -2155,7 +2155,7 @@ g_desktop_app_info_get_icon (GAppInfo *appinfo)
*
* Gets the categories from the desktop file.
*
* Returns: The unparsed Categories key from the desktop file;
* Returns: (nullable): The unparsed Categories key from the desktop file;
* i.e. no attempt is made to split it by ';' or validate it.
*/
const char *
@ -2184,9 +2184,9 @@ g_desktop_app_info_get_keywords (GDesktopAppInfo *info)
* g_desktop_app_info_get_generic_name:
* @info: a #GDesktopAppInfo
*
* Gets the generic name from the destkop file.
* Gets the generic name from the desktop file.
*
* Returns: The value of the GenericName key
* Returns: (nullable): The value of the GenericName key
*/
const char *
g_desktop_app_info_get_generic_name (GDesktopAppInfo *info)
@ -4679,7 +4679,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
* WM_CLASS property of the main window of the application, if launched
* through @info.
*
* Returns: (transfer none): the startup WM class, or %NULL if none is set
* Returns: (nullable) (transfer none): the startup WM class, or %NULL if none is set
* in the desktop file.
*
* Since: 2.34
@ -4701,7 +4701,7 @@ g_desktop_app_info_get_startup_wm_class (GDesktopAppInfo *info)
*
* The @key is looked up in the "Desktop Entry" group.
*
* Returns: a newly allocated string, or %NULL if the key
* Returns: (nullable): a newly allocated string, or %NULL if the key
* is not found
*
* Since: 2.36

View File

@ -111,6 +111,19 @@ g_file_icon_set_property (GObject *object,
}
}
static void
g_file_icon_constructed (GObject *object)
{
GFileIcon *icon;
G_OBJECT_CLASS (g_file_icon_parent_class)->constructed (object);
icon = G_FILE_ICON (object);
/* Must have be set during construction */
g_assert (icon->file != NULL);
}
static void
g_file_icon_finalize (GObject *object)
{
@ -132,6 +145,7 @@ g_file_icon_class_init (GFileIconClass *klass)
gobject_class->get_property = g_file_icon_get_property;
gobject_class->set_property = g_file_icon_set_property;
gobject_class->finalize = g_file_icon_finalize;
gobject_class->constructed = g_file_icon_constructed;
/**
* GFileIcon:file:
@ -174,7 +188,7 @@ g_file_icon_new (GFile *file)
*
* Gets the #GFile associated with the given @icon.
*
* Returns: (transfer none): a #GFile, or %NULL.
* Returns: (transfer none): a #GFile.
**/
GFile *
g_file_icon_get_file (GFileIcon *icon)

View File

@ -1652,7 +1652,7 @@ g_file_info_get_edit_name (GFileInfo *info)
*
* Gets the icon for a file.
*
* Returns: (transfer none): #GIcon for the given @info.
* Returns: (nullable) (transfer none): #GIcon for the given @info.
**/
GIcon *
g_file_info_get_icon (GFileInfo *info)
@ -1679,7 +1679,7 @@ g_file_info_get_icon (GFileInfo *info)
*
* Gets the symbolic icon for a file.
*
* Returns: (transfer none): #GIcon for the given @info.
* Returns: (nullable) (transfer none): #GIcon for the given @info.
*
* Since: 2.34
**/
@ -1835,7 +1835,7 @@ g_file_info_get_modification_date_time (GFileInfo *info)
*
* Gets the symlink target for a given #GFileInfo.
*
* Returns: a string containing the symlink target.
* Returns: (nullable): a string containing the symlink target.
**/
const char *
g_file_info_get_symlink_target (GFileInfo *info)
@ -1859,7 +1859,7 @@ g_file_info_get_symlink_target (GFileInfo *info)
* Gets the [entity tag][gfile-etag] for a given
* #GFileInfo. See %G_FILE_ATTRIBUTE_ETAG_VALUE.
*
* Returns: a string containing the value of the "etag:value" attribute.
* Returns: (nullable): a string containing the value of the "etag:value" attribute.
**/
const char *
g_file_info_get_etag (GFileInfo *info)
@ -2464,8 +2464,8 @@ g_file_attribute_matcher_new (const char *attributes)
/**
* g_file_attribute_matcher_subtract:
* @matcher: Matcher to subtract from
* @subtract: The matcher to subtract
* @matcher: (nullable): Matcher to subtract from
* @subtract: (nullable): The matcher to subtract
*
* Subtracts all attributes of @subtract from @matcher and returns
* a matcher that supports those attributes.
@ -2476,7 +2476,7 @@ g_file_attribute_matcher_new (const char *attributes)
* is a limitation of the current implementation, but may be fixed
* in the future.
*
* Returns: A file attribute matcher matching all attributes of
* Returns: (nullable): A file attribute matcher matching all attributes of
* @matcher that are not matched by @subtract
**/
GFileAttributeMatcher *

View File

@ -277,7 +277,7 @@ g_file_io_stream_query_info_finish (GFileIOStream *stream,
* This must be called after the stream has been written
* and closed, as the etag can change while writing.
*
* Returns: the entity tag for the stream.
* Returns: (nullable) (transfer full): the entity tag for the stream.
*
* Since: 2.22
**/

View File

@ -404,9 +404,9 @@ init_completion (GFilenameCompleter *completer,
*
* Obtains a completion for @initial_text from @completer.
*
* Returns: a completed string, or %NULL if no completion exists.
* This string is not owned by GIO, so remember to g_free() it
* when finished.
* Returns: (nullable) (transfer full): a completed string, or %NULL if no
* completion exists. This string is not owned by GIO, so remember to g_free()
* it when finished.
**/
char *
g_filename_completer_get_completion_suffix (GFilenameCompleter *completer,

View File

@ -271,7 +271,7 @@ g_file_output_stream_query_info_finish (GFileOutputStream *stream,
* This must be called after the stream has been written
* and closed, as the etag can change while writing.
*
* Returns: the entity tag for the stream.
* Returns: (nullable) (transfer full): the entity tag for the stream.
**/
char *
g_file_output_stream_get_etag (GFileOutputStream *stream)

View File

@ -562,7 +562,7 @@ g_icon_deserialize_emblemed (GVariant *value)
*
* Deserializes a #GIcon previously serialized using g_icon_serialize().
*
* Returns: (transfer full): a #GIcon, or %NULL when deserialization fails.
* Returns: (nullable) (transfer full): a #GIcon, or %NULL when deserialization fails.
*
* Since: 2.38
*/
@ -653,7 +653,7 @@ g_icon_deserialize (GVariant *value)
* makes sense to transfer the #GVariant between processes on the same machine,
* (as opposed to over the network), and within the same file system namespace.
*
* Returns: (transfer full): a #GVariant, or %NULL when serialization fails. The #GVariant will not be floating.
* Returns: (nullable) (transfer full): a #GVariant, or %NULL when serialization fails. The #GVariant will not be floating.
*
* Since: 2.38
*/

View File

@ -118,7 +118,7 @@ static guint signals[LAST_SIGNAL] = { 0 };
*
* Gets a reference to the default #GMemoryMonitor for the system.
*
* Returns: (transfer full): a new reference to the default #GMemoryMonitor
* Returns: (not nullable) (transfer full): a new reference to the default #GMemoryMonitor
*
* Since: 2.64
*/

View File

@ -781,7 +781,7 @@ g_menu_item_set_link (GMenuItem *menu_item,
* type, %NULL is returned. %NULL is also returned if the attribute
* simply does not exist.
*
* Returns: (transfer full): the attribute value, or %NULL
* Returns: (nullable) (transfer full): the attribute value, or %NULL
*
* Since: 2.34
*/
@ -865,7 +865,7 @@ g_menu_item_get_attribute (GMenuItem *menu_item,
*
* Queries the named @link on @menu_item.
*
* Returns: (transfer full): the link, or %NULL
* Returns: (nullable) (transfer full): the link, or %NULL
*
* Since: 2.34
*/

View File

@ -541,7 +541,7 @@ g_menu_model_iterate_item_attributes (GMenuModel *model,
* If the attribute does not exist, or does not match the expected type
* then %NULL is returned.
*
* Returns: (transfer full): the value of the attribute
* Returns: (nullable) (transfer full): the value of the attribute
*
* Since: 2.32
*/
@ -648,7 +648,7 @@ g_menu_model_iterate_item_links (GMenuModel *model,
* If the link exists, the linked #GMenuModel is returned. If the link
* does not exist, %NULL is returned.
*
* Returns: (transfer full): the linked #GMenuModel, or %NULL
* Returns: (nullable) (transfer full): the linked #GMenuModel, or %NULL
*
* Since: 2.32
*/

View File

@ -638,7 +638,7 @@ g_mount_operation_new (void)
*
* Get the user name from the mount operation.
*
* Returns: a string containing the user name.
* Returns: (nullable): a string containing the user name.
**/
const char *
g_mount_operation_get_username (GMountOperation *op)
@ -650,7 +650,7 @@ g_mount_operation_get_username (GMountOperation *op)
/**
* g_mount_operation_set_username:
* @op: a #GMountOperation.
* @username: input username.
* @username: (nullable): input username.
*
* Sets the user name within @op to @username.
**/
@ -670,7 +670,7 @@ g_mount_operation_set_username (GMountOperation *op,
*
* Gets a password from the mount operation.
*
* Returns: a string containing the password within @op.
* Returns: (nullable): a string containing the password within @op.
**/
const char *
g_mount_operation_get_password (GMountOperation *op)
@ -682,7 +682,7 @@ g_mount_operation_get_password (GMountOperation *op)
/**
* g_mount_operation_set_password:
* @op: a #GMountOperation.
* @password: password to set.
* @password: (nullable): password to set.
*
* Sets the mount operation's password to @password.
*
@ -741,7 +741,7 @@ g_mount_operation_set_anonymous (GMountOperation *op,
*
* Gets the domain of the mount operation.
*
* Returns: a string set to the domain.
* Returns: (nullable): a string set to the domain.
**/
const char *
g_mount_operation_get_domain (GMountOperation *op)
@ -753,7 +753,7 @@ g_mount_operation_get_domain (GMountOperation *op)
/**
* g_mount_operation_set_domain:
* @op: a #GMountOperation.
* @domain: the domain to set.
* @domain: (nullable): the domain to set.
*
* Sets the mount operation's domain.
**/

View File

@ -611,7 +611,7 @@ g_network_address_get_port (GNetworkAddress *addr)
*
* Gets @addr's scheme
*
* Returns: @addr's scheme (%NULL if not built from URI)
* Returns: (nullable): @addr's scheme (%NULL if not built from URI)
*
* Since: 2.26
*/

View File

@ -83,7 +83,8 @@ static guint signals[LAST_SIGNAL] = { 0 };
*
* Gets the default #GNetworkMonitor for the system.
*
* Returns: (transfer none): a #GNetworkMonitor
* Returns: (not nullable) (transfer none): a #GNetworkMonitor, which will be
* a dummy object if no network monitor is available
*
* Since: 2.32
*/

View File

@ -55,7 +55,7 @@ g_proxy_default_init (GProxyInterface *iface)
* Find the `gio-proxy` extension point for a proxy implementation that supports
* the specified protocol.
*
* Returns: (transfer full): return a #GProxy or NULL if protocol
* Returns: (nullable) (transfer full): return a #GProxy or NULL if protocol
* is not supported.
*
* Since: 2.26

View File

@ -409,7 +409,7 @@ g_proxy_address_get_destination_port (GProxyAddress *proxy)
*
* Gets @proxy's username.
*
* Returns: the @proxy's username
* Returns: (nullable): the @proxy's username
*
* Since: 2.26
*/
@ -425,7 +425,7 @@ g_proxy_address_get_username (GProxyAddress *proxy)
*
* Gets @proxy's password.
*
* Returns: the @proxy's password
* Returns: (nullable): the @proxy's password
*
* Since: 2.26
*/
@ -442,7 +442,7 @@ g_proxy_address_get_password (GProxyAddress *proxy)
*
* Gets the proxy URI that @proxy was constructed from.
*
* Returns: the @proxy's URI, or %NULL if unknown
* Returns: (nullable): the @proxy's URI, or %NULL if unknown
*
* Since: 2.34
*/

View File

@ -72,7 +72,8 @@ g_proxy_resolver_default_init (GProxyResolverInterface *iface)
*
* Gets the default #GProxyResolver for the system.
*
* Returns: (transfer none): the default #GProxyResolver.
* Returns: (not nullable) (transfer none): the default #GProxyResolver, which
* will be a dummy object if no proxy resolver is available
*
* Since: 2.26
*/

View File

@ -1001,7 +1001,9 @@ g_settings_backend_verify (gpointer impl)
*
* The user gets a reference to the backend.
*
* Returns: (transfer full): the default #GSettingsBackend
* Returns: (not nullable) (transfer full): the default #GSettingsBackend,
* which will be a dummy (memory) settings backend if no other settings
* backend is available.
*
* Since: 2.28
*/

View File

@ -1001,7 +1001,7 @@ g_settings_schema_get_value (GSettingsSchema *schema,
* therefore describe multiple sets of keys at different locations. For
* relocatable schemas, this function will return %NULL.
*
* Returns: (transfer none): the path of the schema, or %NULL
* Returns: (nullable) (transfer none): the path of the schema, or %NULL
*
* Since: 2.32
**/
@ -1660,7 +1660,7 @@ g_settings_schema_key_get_name (GSettingsSchemaKey *key)
* function has to parse all of the source XML files in the schema
* directory.
*
* Returns: the summary for @key, or %NULL
* Returns: (nullable): the summary for @key, or %NULL
*
* Since: 2.34
**/
@ -1695,7 +1695,7 @@ g_settings_schema_key_get_summary (GSettingsSchemaKey *key)
* function has to parse all of the source XML files in the schema
* directory.
*
* Returns: the description for @key, or %NULL
* Returns: (nullable): the description for @key, or %NULL
*
* Since: 2.34
**/

View File

@ -491,7 +491,7 @@ g_socket_client_set_protocol (GSocketClient *client,
*
* See g_socket_client_set_local_address() for details.
*
* Returns: (transfer none): a #GSocketAddress or %NULL. Do not free.
* Returns: (nullable) (transfer none): a #GSocketAddress or %NULL. Do not free.
*
* Since: 2.22
*/

View File

@ -773,10 +773,10 @@ g_subprocess_get_identifier (GSubprocess *subprocess)
* Gets the #GOutputStream that you can write to in order to give data
* to the stdin of @subprocess.
*
* The process must have been created with
* %G_SUBPROCESS_FLAGS_STDIN_PIPE.
* The process must have been created with %G_SUBPROCESS_FLAGS_STDIN_PIPE and
* not %G_SUBPROCESS_FLAGS_STDIN_INHERIT, otherwise %NULL will be returned.
*
* Returns: (transfer none): the stdout pipe
* Returns: (nullable) (transfer none): the stdout pipe
*
* Since: 2.40
**/
@ -784,7 +784,6 @@ GOutputStream *
g_subprocess_get_stdin_pipe (GSubprocess *subprocess)
{
g_return_val_if_fail (G_IS_SUBPROCESS (subprocess), NULL);
g_return_val_if_fail (subprocess->stdin_pipe, NULL);
return subprocess->stdin_pipe;
}
@ -796,10 +795,10 @@ g_subprocess_get_stdin_pipe (GSubprocess *subprocess)
* Gets the #GInputStream from which to read the stdout output of
* @subprocess.
*
* The process must have been created with
* %G_SUBPROCESS_FLAGS_STDOUT_PIPE.
* The process must have been created with %G_SUBPROCESS_FLAGS_STDOUT_PIPE,
* otherwise %NULL will be returned.
*
* Returns: (transfer none): the stdout pipe
* Returns: (nullable) (transfer none): the stdout pipe
*
* Since: 2.40
**/
@ -807,7 +806,6 @@ GInputStream *
g_subprocess_get_stdout_pipe (GSubprocess *subprocess)
{
g_return_val_if_fail (G_IS_SUBPROCESS (subprocess), NULL);
g_return_val_if_fail (subprocess->stdout_pipe, NULL);
return subprocess->stdout_pipe;
}
@ -819,10 +817,10 @@ g_subprocess_get_stdout_pipe (GSubprocess *subprocess)
* Gets the #GInputStream from which to read the stderr output of
* @subprocess.
*
* The process must have been created with
* %G_SUBPROCESS_FLAGS_STDERR_PIPE.
* The process must have been created with %G_SUBPROCESS_FLAGS_STDERR_PIPE,
* otherwise %NULL will be returned.
*
* Returns: (transfer none): the stderr pipe
* Returns: (nullable) (transfer none): the stderr pipe
*
* Since: 2.40
**/
@ -830,7 +828,6 @@ GInputStream *
g_subprocess_get_stderr_pipe (GSubprocess *subprocess)
{
g_return_val_if_fail (G_IS_SUBPROCESS (subprocess), NULL);
g_return_val_if_fail (subprocess->stderr_pipe, NULL);
return subprocess->stderr_pipe;
}

View File

@ -303,7 +303,7 @@ g_subprocess_launcher_unsetenv (GSubprocessLauncher *self,
* On UNIX, the returned string can be an arbitrary byte string.
* On Windows, it will be UTF-8.
*
* Returns: (type filename): the value of the environment variable,
* Returns: (nullable) (type filename): the value of the environment variable,
* %NULL if unset
*
* Since: 2.40

View File

@ -98,7 +98,8 @@ g_tls_backend_default_init (GTlsBackendInterface *iface)
*
* Gets the default #GTlsBackend for the system.
*
* Returns: (transfer none): a #GTlsBackend
* Returns: (not nullable) (transfer none): a #GTlsBackend, which will be a
* dummy object if no TLS backend is available
*
* Since: 2.28
*/

View File

@ -784,7 +784,7 @@ g_tls_certificate_list_new_from_file (const gchar *file,
*
* Gets the #GTlsCertificate representing @cert's issuer, if known
*
* Returns: (transfer none): The certificate of @cert's issuer,
* Returns: (nullable) (transfer none): The certificate of @cert's issuer,
* or %NULL if @cert is self-signed or signed with an unknown
* certificate.
*

View File

@ -224,7 +224,7 @@ g_tls_client_connection_set_validation_flags (GTlsClientConnection *conn,
*
* Gets @conn's expected server identity
*
* Returns: (transfer none): a #GSocketConnectable describing the
* Returns: (nullable) (transfer none): a #GSocketConnectable describing the
* expected server identity, or %NULL if the expected identity is not
* known.
*

View File

@ -2491,7 +2491,7 @@ g_unix_mount_point_get_fs_type (GUnixMountPoint *mount_point)
*
* Gets the options for the mount point.
*
* Returns: a string containing the options.
* Returns: (nullable): a string containing the options.
*
* Since: 2.32
*/

View File

@ -342,7 +342,8 @@ g_vfs_parse_name (GVfs *vfs,
*
* Gets the default #GVfs for the system.
*
* Returns: (transfer none): a #GVfs.
* Returns: (not nullable) (transfer none): a #GVfs, which will be the local
* file system #GVfs if no other implementation is available.
*/
GVfs *
g_vfs_get_default (void)

View File

@ -353,7 +353,7 @@ g_volume_monitor_get_mounts (GVolumeMonitor *volume_monitor)
*
* Finds a #GVolume object by its UUID (see g_volume_get_uuid())
*
* Returns: (transfer full): a #GVolume or %NULL if no such volume is available.
* Returns: (nullable) (transfer full): a #GVolume or %NULL if no such volume is available.
* Free the returned object with g_object_unref().
**/
GVolume *
@ -377,7 +377,7 @@ g_volume_monitor_get_volume_for_uuid (GVolumeMonitor *volume_monitor,
*
* Finds a #GMount object by its UUID (see g_mount_get_uuid())
*
* Returns: (transfer full): a #GMount or %NULL if no such mount is available.
* Returns: (nullable) (transfer full): a #GMount or %NULL if no such mount is available.
* Free the returned object with g_object_unref().
**/
GMount *

View File

@ -296,7 +296,7 @@ g_zlib_compressor_new (GZlibCompressorFormat format,
*
* Returns the #GZlibCompressor:file-info property.
*
* Returns: (transfer none): a #GFileInfo, or %NULL
* Returns: (nullable) (transfer none): a #GFileInfo, or %NULL
*
* Since: 2.26
*/

View File

@ -282,7 +282,7 @@ g_zlib_decompressor_new (GZlibCompressorFormat format)
* or the header data was not fully processed yet, or it not present in the
* data stream at all.
*
* Returns: (transfer none): a #GFileInfo, or %NULL
* Returns: (nullable) (transfer none): a #GFileInfo, or %NULL
*
* Since: 2.26
*/