From 18574d1ba9dae51bc49942201b3f6401b5051e2a Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 15 Nov 2022 17:48:47 +0000 Subject: [PATCH] gnotification: Improve docs around GVariant ownership MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a few missing introspection annotations too. This doesn’t change any of the ownership handling behaviour, just documents what’s there. What’s there seems to be correct, to the extent that I can see. Signed-off-by: Philip Withnall --- gio/gnotification.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gio/gnotification.c b/gio/gnotification.c index 19bfca372..6848895b2 100644 --- a/gio/gnotification.c +++ b/gio/gnotification.c @@ -102,7 +102,7 @@ struct _GNotification gchar *category; GPtrArray *buttons; gchar *default_action; - GVariant *default_action_target; + GVariant *default_action_target; /* (nullable) (owned), not floating */ }; typedef struct @@ -615,11 +615,17 @@ g_notification_get_button_with_action (GNotification *notification, /*< private > * g_notification_get_default_action: * @notification: a #GNotification - * @action: (nullable): return location for the default action - * @target: (nullable): return location for the target of the default action + * @action: (out) (optional) (nullable) (transfer full): return location for the + * default action, or %NULL if unset + * @target: (out) (optional) (nullable) (transfer full): return location for the + * target of the default action, or %NULL if unset * * Gets the action and target for the default action of @notification. * + * If this function returns %TRUE, @action is guaranteed to be set to a non-%NULL + * value (if a pointer is passed to @action). @target may still return a %NULL + * value, as the default action may have no target. + * * Returns: %TRUE if @notification has a default action */ gboolean @@ -736,7 +742,7 @@ g_notification_set_default_action_and_target (GNotification *notification, * application-wide action (start with "app."). * * If @target is non-%NULL, @action will be activated with @target as - * its parameter. + * its parameter. If @target is floating, it will be consumed. * * When no default action is set, the application that the notification * was sent on is activated.