mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
gfdonotificationbackend: Improve internal docs around floating GVariants
The code is correct, but from a quick read-through it wasn’t entirely clear to me how it handled floating `GVariant`s in object state or the `parameter` argument. Add an assertion and some comments to hopefully clarify things a little. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
d470e7227a
commit
716189c4c7
@ -63,8 +63,8 @@ typedef struct
|
||||
GFdoNotificationBackend *backend;
|
||||
gchar *id;
|
||||
guint32 notify_id;
|
||||
gchar *default_action;
|
||||
GVariant *default_action_target;
|
||||
gchar *default_action; /* (nullable) (owned) */
|
||||
GVariant *default_action_target; /* (nullable) (owned), not floating */
|
||||
} FreedesktopNotification;
|
||||
|
||||
static void
|
||||
@ -138,6 +138,9 @@ activate_action (GFdoNotificationBackend *backend,
|
||||
{
|
||||
GNotificationBackend *g_backend = G_NOTIFICATION_BACKEND (backend);
|
||||
|
||||
/* Callers should not provide a floating variant here */
|
||||
g_assert (parameter == NULL || !g_variant_is_floating (parameter));
|
||||
|
||||
if (name)
|
||||
{
|
||||
if (g_str_has_prefix (name, "app."))
|
||||
|
Loading…
Reference in New Issue
Block a user