mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 15:06:14 +01:00
gio: use g_variant_builder_init_static()
All uses of g_variant_builder_init() in gio are safe to translate to the new g_variant_builder_init_static() alternative as the type will outlive the call to g_variant_builder_end() (or is already static in nature).
This commit is contained in:
parent
bfac590364
commit
0f95b18a7b
@ -51,7 +51,7 @@ g_action_group_describe_action (GActionGroup *action_group,
|
|||||||
gboolean enabled;
|
gboolean enabled;
|
||||||
GVariant *state;
|
GVariant *state;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("(bgav)"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("(bgav)"));
|
||||||
|
|
||||||
enabled = g_action_group_get_action_enabled (action_group, name);
|
enabled = g_action_group_get_action_enabled (action_group, name);
|
||||||
g_variant_builder_add (&builder, "b", enabled);
|
g_variant_builder_add (&builder, "b", enabled);
|
||||||
@ -146,10 +146,10 @@ g_action_group_exporter_dispatch_events (gpointer user_data)
|
|||||||
gpointer value;
|
gpointer value;
|
||||||
gpointer key;
|
gpointer key;
|
||||||
|
|
||||||
g_variant_builder_init (&removes, G_VARIANT_TYPE_STRING_ARRAY);
|
g_variant_builder_init_static (&removes, G_VARIANT_TYPE_STRING_ARRAY);
|
||||||
g_variant_builder_init (&enabled_changes, G_VARIANT_TYPE ("a{sb}"));
|
g_variant_builder_init_static (&enabled_changes, G_VARIANT_TYPE ("a{sb}"));
|
||||||
g_variant_builder_init (&state_changes, G_VARIANT_TYPE ("a{sv}"));
|
g_variant_builder_init_static (&state_changes, G_VARIANT_TYPE ("a{sv}"));
|
||||||
g_variant_builder_init (&adds, G_VARIANT_TYPE ("a{s(bgav)}"));
|
g_variant_builder_init_static (&adds, G_VARIANT_TYPE ("a{s(bgav)}"));
|
||||||
|
|
||||||
g_hash_table_iter_init (&iter, exporter->pending_changes);
|
g_hash_table_iter_init (&iter, exporter->pending_changes);
|
||||||
while (g_hash_table_iter_next (&iter, &key, &value))
|
while (g_hash_table_iter_next (&iter, &key, &value))
|
||||||
@ -410,7 +410,7 @@ org_gtk_Actions_method_call (GDBusConnection *connection,
|
|||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
list = g_action_group_list_actions (exporter->action_group);
|
list = g_action_group_list_actions (exporter->action_group);
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{s(bgav)}"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{s(bgav)}"));
|
||||||
for (i = 0; list[i]; i++)
|
for (i = 0; list[i]; i++)
|
||||||
{
|
{
|
||||||
const gchar *name = list[i];
|
const gchar *name = list[i];
|
||||||
|
@ -299,7 +299,7 @@ app_get_platform_data (void)
|
|||||||
GVariantBuilder builder;
|
GVariantBuilder builder;
|
||||||
const gchar *startup_id;
|
const gchar *startup_id;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE_VARDICT);
|
||||||
|
|
||||||
if ((startup_id = g_getenv ("DESKTOP_STARTUP_ID")))
|
if ((startup_id = g_getenv ("DESKTOP_STARTUP_ID")))
|
||||||
g_variant_builder_add (&builder, "{sv}", "desktop-startup-id", g_variant_new_string (startup_id));
|
g_variant_builder_add (&builder, "{sv}", "desktop-startup-id", g_variant_new_string (startup_id));
|
||||||
@ -334,7 +334,7 @@ app_action (gchar **args)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_variant_builder_init (¶ms, G_VARIANT_TYPE ("av"));
|
g_variant_builder_init_static (¶ms, G_VARIANT_TYPE ("av"));
|
||||||
|
|
||||||
if (args[2])
|
if (args[2])
|
||||||
{
|
{
|
||||||
@ -387,7 +387,7 @@ app_launch (gchar **args)
|
|||||||
if (args[1] == NULL)
|
if (args[1] == NULL)
|
||||||
return app_activate (args[0]);
|
return app_activate (args[0]);
|
||||||
|
|
||||||
g_variant_builder_init (&files, G_VARIANT_TYPE_STRING_ARRAY);
|
g_variant_builder_init_static (&files, G_VARIANT_TYPE_STRING_ARRAY);
|
||||||
|
|
||||||
for (i = 1; args[i]; i++)
|
for (i = 1; args[i]; i++)
|
||||||
{
|
{
|
||||||
|
@ -156,7 +156,7 @@ send_property_change (GApplicationImpl *impl)
|
|||||||
{
|
{
|
||||||
GVariantBuilder builder;
|
GVariantBuilder builder;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE_ARRAY);
|
||||||
g_variant_builder_add (&builder,
|
g_variant_builder_add (&builder,
|
||||||
"{sv}",
|
"{sv}",
|
||||||
"Busy", g_variant_new_boolean (impl->busy));
|
"Busy", g_variant_new_boolean (impl->busy));
|
||||||
@ -311,7 +311,7 @@ g_application_impl_method_call (GDBusConnection *connection,
|
|||||||
GVariant *value = NULL;
|
GVariant *value = NULL;
|
||||||
GVariantBuilder builder;
|
GVariantBuilder builder;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE);
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE_TUPLE);
|
||||||
|
|
||||||
while (g_variant_iter_loop (iter, "v", &value))
|
while (g_variant_iter_loop (iter, "v", &value))
|
||||||
{
|
{
|
||||||
@ -736,7 +736,7 @@ g_application_impl_open (GApplicationImpl *impl,
|
|||||||
GVariantBuilder builder;
|
GVariantBuilder builder;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("(assa{sv})"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("(assa{sv})"));
|
||||||
g_variant_builder_open (&builder, G_VARIANT_TYPE_STRING_ARRAY);
|
g_variant_builder_open (&builder, G_VARIANT_TYPE_STRING_ARRAY);
|
||||||
for (i = 0; i < n_files; i++)
|
for (i = 0; i < n_files; i++)
|
||||||
{
|
{
|
||||||
|
@ -802,7 +802,7 @@ handle_emit (gint *argc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Read parameters */
|
/* Read parameters */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE);
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE_TUPLE);
|
||||||
skip_dashes = TRUE;
|
skip_dashes = TRUE;
|
||||||
parm = 0;
|
parm = 0;
|
||||||
for (n = 1; n < (guint) *argc; n++)
|
for (n = 1; n < (guint) *argc; n++)
|
||||||
@ -1114,7 +1114,7 @@ handle_call (gint *argc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Read parameters */
|
/* Read parameters */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE);
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE_TUPLE);
|
||||||
skip_dashes = TRUE;
|
skip_dashes = TRUE;
|
||||||
parm = 0;
|
parm = 0;
|
||||||
for (n = 1; n < (guint) *argc; n++)
|
for (n = 1; n < (guint) *argc; n++)
|
||||||
|
@ -376,7 +376,7 @@ g_dbus_action_group_activate_action_full (GRemoteActionGroup *remote,
|
|||||||
GDBusActionGroup *group = G_DBUS_ACTION_GROUP (remote);
|
GDBusActionGroup *group = G_DBUS_ACTION_GROUP (remote);
|
||||||
GVariantBuilder builder;
|
GVariantBuilder builder;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("av"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("av"));
|
||||||
|
|
||||||
if (parameter)
|
if (parameter)
|
||||||
g_variant_builder_add (&builder, "v", parameter);
|
g_variant_builder_add (&builder, "v", parameter);
|
||||||
|
@ -5087,7 +5087,7 @@ invoke_get_all_properties_in_idle_cb (gpointer _data)
|
|||||||
* We could fail the whole call if just a single get_property() call
|
* We could fail the whole call if just a single get_property() call
|
||||||
* returns an error. We need clarification in the D-Bus spec about this.
|
* returns an error. We need clarification in the D-Bus spec about this.
|
||||||
*/
|
*/
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("(a{sv})"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("(a{sv})"));
|
||||||
g_variant_builder_open (&builder, G_VARIANT_TYPE ("a{sv}"));
|
g_variant_builder_open (&builder, G_VARIANT_TYPE ("a{sv}"));
|
||||||
for (n = 0; data->interface_info->properties != NULL && data->interface_info->properties[n] != NULL; n++)
|
for (n = 0; data->interface_info->properties != NULL && data->interface_info->properties[n] != NULL; n++)
|
||||||
{
|
{
|
||||||
|
@ -1982,7 +1982,7 @@ parse_value_from_blob (GMemoryBuffer *buf,
|
|||||||
goffset offset;
|
goffset offset;
|
||||||
goffset target;
|
goffset target;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, type);
|
g_variant_builder_init_static (&builder, type);
|
||||||
|
|
||||||
if (array_len == 0)
|
if (array_len == 0)
|
||||||
{
|
{
|
||||||
@ -2091,7 +2091,7 @@ parse_value_from_blob (GMemoryBuffer *buf,
|
|||||||
const GVariantType *element_type;
|
const GVariantType *element_type;
|
||||||
GVariantBuilder builder;
|
GVariantBuilder builder;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, type);
|
g_variant_builder_init_static (&builder, type);
|
||||||
element_type = g_variant_type_first (type);
|
element_type = g_variant_type_first (type);
|
||||||
if (!element_type)
|
if (!element_type)
|
||||||
{
|
{
|
||||||
@ -3028,7 +3028,7 @@ g_dbus_message_to_blob (GDBusMessage *message,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{yv}"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{yv}"));
|
||||||
g_hash_table_iter_init (&hash_iter, message->headers);
|
g_hash_table_iter_init (&hash_iter, message->headers);
|
||||||
while (g_hash_table_iter_next (&hash_iter, &key, (gpointer) &header_value))
|
while (g_hash_table_iter_next (&hash_iter, &key, (gpointer) &header_value))
|
||||||
{
|
{
|
||||||
|
@ -869,7 +869,7 @@ manager_method_call (GDBusConnection *connection,
|
|||||||
|
|
||||||
if (g_strcmp0 (method_name, "GetManagedObjects") == 0)
|
if (g_strcmp0 (method_name, "GetManagedObjects") == 0)
|
||||||
{
|
{
|
||||||
g_variant_builder_init (&array_builder, G_VARIANT_TYPE ("a{oa{sa{sv}}}"));
|
g_variant_builder_init_static (&array_builder, G_VARIANT_TYPE ("a{oa{sa{sv}}}"));
|
||||||
g_hash_table_iter_init (&object_iter, manager->priv->map_object_path_to_data);
|
g_hash_table_iter_init (&object_iter, manager->priv->map_object_path_to_data);
|
||||||
while (g_hash_table_iter_next (&object_iter, NULL, (gpointer) &data))
|
while (g_hash_table_iter_next (&object_iter, NULL, (gpointer) &data))
|
||||||
{
|
{
|
||||||
@ -878,7 +878,7 @@ manager_method_call (GDBusConnection *connection,
|
|||||||
GDBusInterfaceSkeleton *iface;
|
GDBusInterfaceSkeleton *iface;
|
||||||
const gchar *iter_object_path;
|
const gchar *iter_object_path;
|
||||||
|
|
||||||
g_variant_builder_init (&interfaces_builder, G_VARIANT_TYPE ("a{sa{sv}}"));
|
g_variant_builder_init_static (&interfaces_builder, G_VARIANT_TYPE ("a{sa{sv}}"));
|
||||||
g_hash_table_iter_init (&interface_iter, data->map_iface_name_to_iface);
|
g_hash_table_iter_init (&interface_iter, data->map_iface_name_to_iface);
|
||||||
while (g_hash_table_iter_next (&interface_iter, NULL, (gpointer) &iface))
|
while (g_hash_table_iter_next (&interface_iter, NULL, (gpointer) &iface))
|
||||||
{
|
{
|
||||||
@ -945,7 +945,7 @@ g_dbus_object_manager_server_emit_interfaces_added (GDBusObjectManagerServer *ma
|
|||||||
if (data->manager->priv->connection == NULL)
|
if (data->manager->priv->connection == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
g_variant_builder_init (&array_builder, G_VARIANT_TYPE ("a{sa{sv}}"));
|
g_variant_builder_init_static (&array_builder, G_VARIANT_TYPE ("a{sa{sv}}"));
|
||||||
for (n = 0; interfaces[n] != NULL; n++)
|
for (n = 0; interfaces[n] != NULL; n++)
|
||||||
{
|
{
|
||||||
GDBusInterfaceSkeleton *iface;
|
GDBusInterfaceSkeleton *iface;
|
||||||
@ -991,7 +991,7 @@ g_dbus_object_manager_server_emit_interfaces_removed (GDBusObjectManagerServer *
|
|||||||
if (data->manager->priv->connection == NULL)
|
if (data->manager->priv->connection == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
g_variant_builder_init (&array_builder, G_VARIANT_TYPE ("as"));
|
g_variant_builder_init_static (&array_builder, G_VARIANT_TYPE ("as"));
|
||||||
for (n = 0; interfaces[n] != NULL; n++)
|
for (n = 0; interfaces[n] != NULL; n++)
|
||||||
g_variant_builder_add (&array_builder, "s", interfaces[n]);
|
g_variant_builder_add (&array_builder, "s", interfaces[n]);
|
||||||
|
|
||||||
|
@ -954,7 +954,7 @@ invalidated_property_get_cb (GDBusConnection *connection,
|
|||||||
g_variant_get (value, "(v)", &unpacked_value);
|
g_variant_get (value, "(v)", &unpacked_value);
|
||||||
|
|
||||||
/* synthesize the a{sv} in the PropertiesChanged signal */
|
/* synthesize the a{sv} in the PropertiesChanged signal */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}"));
|
||||||
g_variant_builder_add (&builder, "{sv}", data->prop_name, unpacked_value);
|
g_variant_builder_add (&builder, "{sv}", data->prop_name, unpacked_value);
|
||||||
|
|
||||||
G_LOCK (properties_lock);
|
G_LOCK (properties_lock);
|
||||||
@ -1264,7 +1264,7 @@ on_name_owner_changed (GDBusConnection *connection,
|
|||||||
const gchar *key;
|
const gchar *key;
|
||||||
|
|
||||||
/* Build changed_properties (always empty) and invalidated_properties ... */
|
/* Build changed_properties (always empty) and invalidated_properties ... */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}"));
|
||||||
|
|
||||||
invalidated_properties = g_ptr_array_new_with_free_func (g_free);
|
invalidated_properties = g_ptr_array_new_with_free_func (g_free);
|
||||||
g_hash_table_iter_init (&iter, proxy->priv->properties);
|
g_hash_table_iter_init (&iter, proxy->priv->properties);
|
||||||
|
@ -235,7 +235,7 @@ set_debug_enabled (GDebugControllerDBus *self,
|
|||||||
/* Notify internally and externally of the property change. */
|
/* Notify internally and externally of the property change. */
|
||||||
g_object_notify (G_OBJECT (self), "debug-enabled");
|
g_object_notify (G_OBJECT (self), "debug-enabled");
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}"));
|
||||||
g_variant_builder_add (&builder, "{sv}", "DebugEnabled", g_variant_new_boolean (priv->debug_enabled));
|
g_variant_builder_add (&builder, "{sv}", "DebugEnabled", g_variant_new_boolean (priv->debug_enabled));
|
||||||
|
|
||||||
g_dbus_connection_emit_signal (priv->connection,
|
g_dbus_connection_emit_signal (priv->connection,
|
||||||
|
@ -2809,11 +2809,11 @@ notify_desktop_launch (GDBusConnection *session_bus,
|
|||||||
if (session_bus == NULL)
|
if (session_bus == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
g_variant_builder_init (&uri_variant, G_VARIANT_TYPE ("as"));
|
g_variant_builder_init_static (&uri_variant, G_VARIANT_TYPE ("as"));
|
||||||
for (iter = uris; iter; iter = iter->next)
|
for (iter = uris; iter; iter = iter->next)
|
||||||
g_variant_builder_add (&uri_variant, "s", iter->data);
|
g_variant_builder_add (&uri_variant, "s", iter->data);
|
||||||
|
|
||||||
g_variant_builder_init (&extras_variant, G_VARIANT_TYPE ("a{sv}"));
|
g_variant_builder_init_static (&extras_variant, G_VARIANT_TYPE ("a{sv}"));
|
||||||
if (sn_id != NULL && g_utf8_validate (sn_id, -1, NULL))
|
if (sn_id != NULL && g_utf8_validate (sn_id, -1, NULL))
|
||||||
g_variant_builder_add (&extras_variant, "{sv}",
|
g_variant_builder_add (&extras_variant, "{sv}",
|
||||||
"startup-id",
|
"startup-id",
|
||||||
@ -2866,7 +2866,7 @@ emit_launch_started (GAppLaunchContext *context,
|
|||||||
|
|
||||||
if (startup_id)
|
if (startup_id)
|
||||||
{
|
{
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE_ARRAY);
|
||||||
g_variant_builder_add (&builder, "{sv}",
|
g_variant_builder_add (&builder, "{sv}",
|
||||||
"startup-notification-id",
|
"startup-notification-id",
|
||||||
g_variant_new_string (startup_id));
|
g_variant_new_string (startup_id));
|
||||||
@ -3070,7 +3070,7 @@ g_desktop_app_info_launch_uris_with_spawn (GDesktopAppInfo *info,
|
|||||||
GVariantBuilder builder;
|
GVariantBuilder builder;
|
||||||
GVariant *platform_data;
|
GVariant *platform_data;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE_ARRAY);
|
||||||
g_variant_builder_add (&builder, "{sv}", "pid", g_variant_new_int32 (pid));
|
g_variant_builder_add (&builder, "{sv}", "pid", g_variant_new_int32 (pid));
|
||||||
if (sn_id)
|
if (sn_id)
|
||||||
g_variant_builder_add (&builder, "{sv}", "startup-notification-id", g_variant_new_string (sn_id));
|
g_variant_builder_add (&builder, "{sv}", "startup-notification-id", g_variant_new_string (sn_id));
|
||||||
@ -3128,7 +3128,7 @@ g_desktop_app_info_make_platform_data (GDesktopAppInfo *info,
|
|||||||
{
|
{
|
||||||
GVariantBuilder builder;
|
GVariantBuilder builder;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE_VARDICT);
|
||||||
|
|
||||||
if (launch_context)
|
if (launch_context)
|
||||||
{
|
{
|
||||||
@ -3190,7 +3190,7 @@ launch_uris_with_dbus_signal_cb (GObject *object,
|
|||||||
{
|
{
|
||||||
GVariant *platform_data;
|
GVariant *platform_data;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE_ARRAY);
|
||||||
/* the docs guarantee `pid` will be set, but we can’t
|
/* the docs guarantee `pid` will be set, but we can’t
|
||||||
* easily know it for a D-Bus process, so set it to zero */
|
* easily know it for a D-Bus process, so set it to zero */
|
||||||
g_variant_builder_add (&builder, "{sv}", "pid", g_variant_new_int32 (0));
|
g_variant_builder_add (&builder, "{sv}", "pid", g_variant_new_int32 (0));
|
||||||
@ -3231,7 +3231,7 @@ launch_uris_with_dbus (GDesktopAppInfo *info,
|
|||||||
gchar *object_path;
|
gchar *object_path;
|
||||||
LaunchUrisWithDBusData *data;
|
LaunchUrisWithDBusData *data;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE);
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE_TUPLE);
|
||||||
|
|
||||||
if (uris)
|
if (uris)
|
||||||
{
|
{
|
||||||
|
@ -143,7 +143,7 @@ g_document_portal_add_documents (GList *uris,
|
|||||||
length = g_list_length (uris);
|
length = g_list_length (uris);
|
||||||
as_is = g_new0 (gboolean, length);
|
as_is = g_new0 (gboolean, length);
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("ah"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("ah"));
|
||||||
|
|
||||||
fd_list = g_unix_fd_list_new ();
|
fd_list = g_unix_fd_list_new ();
|
||||||
for (l = uris, i = 0; l; l = l->next, i++)
|
for (l = uris, i = 0; l; l = l->next, i++)
|
||||||
|
@ -424,7 +424,7 @@ g_emblemed_icon_serialize (GIcon *icon)
|
|||||||
if (!icon_data)
|
if (!icon_data)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("(va(va{sv}))"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("(va(va{sv}))"));
|
||||||
|
|
||||||
g_variant_builder_add (&builder, "v", icon_data);
|
g_variant_builder_add (&builder, "v", icon_data);
|
||||||
g_variant_unref (icon_data);
|
g_variant_unref (icon_data);
|
||||||
|
@ -292,7 +292,7 @@ call_notify (GDBusConnection *con,
|
|||||||
const gchar *body;
|
const gchar *body;
|
||||||
guchar urgency;
|
guchar urgency;
|
||||||
|
|
||||||
g_variant_builder_init (&action_builder, G_VARIANT_TYPE_STRING_ARRAY);
|
g_variant_builder_init_static (&action_builder, G_VARIANT_TYPE_STRING_ARRAY);
|
||||||
if (g_notification_get_default_action (notification, NULL, NULL))
|
if (g_notification_get_default_action (notification, NULL, NULL))
|
||||||
{
|
{
|
||||||
g_variant_builder_add (&action_builder, "s", "default");
|
g_variant_builder_add (&action_builder, "s", "default");
|
||||||
@ -329,7 +329,7 @@ call_notify (GDBusConnection *con,
|
|||||||
g_variant_unref (target);
|
g_variant_unref (target);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_variant_builder_init (&hints_builder, G_VARIANT_TYPE ("a{sv}"));
|
g_variant_builder_init_static (&hints_builder, G_VARIANT_TYPE ("a{sv}"));
|
||||||
g_variant_builder_add (&hints_builder, "{sv}", "desktop-entry",
|
g_variant_builder_add (&hints_builder, "{sv}", "desktop-entry",
|
||||||
g_variant_new_string (g_application_get_application_id (app)));
|
g_variant_new_string (g_application_get_application_id (app)));
|
||||||
urgency = urgency_from_priority (g_notification_get_priority (notification));
|
urgency = urgency_from_priority (g_notification_get_priority (notification));
|
||||||
|
@ -606,7 +606,7 @@ parse_resource_file (const gchar *filename,
|
|||||||
|
|
||||||
g_free (mykey);
|
g_free (mykey);
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("(uuay)"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("(uuay)"));
|
||||||
|
|
||||||
g_variant_builder_add (&builder, "u", data->size); /* Size */
|
g_variant_builder_add (&builder, "u", data->size); /* Size */
|
||||||
g_variant_builder_add (&builder, "u", data->flags); /* Flags */
|
g_variant_builder_add (&builder, "u", data->flags); /* Flags */
|
||||||
|
@ -653,7 +653,7 @@ key_state_serialise (KeyState *state)
|
|||||||
checked = key_state_check (state, NULL);
|
checked = key_state_check (state, NULL);
|
||||||
g_assert (checked);
|
g_assert (checked);
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE);
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE_TUPLE);
|
||||||
|
|
||||||
/* default value */
|
/* default value */
|
||||||
g_variant_builder_add_value (&builder, state->default_value);
|
g_variant_builder_add_value (&builder, state->default_value);
|
||||||
|
@ -197,7 +197,7 @@ g_menu_exporter_menu_describe_item (GMenuExporterMenu *menu,
|
|||||||
const char *name;
|
const char *name;
|
||||||
GVariant *value;
|
GVariant *value;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE_VARDICT);
|
||||||
|
|
||||||
attr_iter = g_menu_model_iterate_item_attributes (menu->model, position);
|
attr_iter = g_menu_model_iterate_item_attributes (menu->model, position);
|
||||||
while (g_menu_attribute_iter_get_next (attr_iter, &name, &value))
|
while (g_menu_attribute_iter_get_next (attr_iter, &name, &value))
|
||||||
@ -221,7 +221,7 @@ g_menu_exporter_menu_list (GMenuExporterMenu *menu)
|
|||||||
GVariantBuilder builder;
|
GVariantBuilder builder;
|
||||||
gint i, n;
|
gint i, n;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("aa{sv}"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("aa{sv}"));
|
||||||
|
|
||||||
n = g_sequence_get_length (menu->item_links);
|
n = g_sequence_get_length (menu->item_links);
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
@ -266,7 +266,7 @@ g_menu_exporter_menu_items_changed (GMenuModel *model,
|
|||||||
{
|
{
|
||||||
GVariantBuilder builder;
|
GVariantBuilder builder;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("(uuuuaa{sv})"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("(uuuuaa{sv})"));
|
||||||
g_variant_builder_add (&builder, "u", g_menu_exporter_group_get_id (menu->group));
|
g_variant_builder_add (&builder, "u", g_menu_exporter_group_get_id (menu->group));
|
||||||
g_variant_builder_add (&builder, "u", menu->id);
|
g_variant_builder_add (&builder, "u", menu->id);
|
||||||
g_variant_builder_add (&builder, "u", position);
|
g_variant_builder_add (&builder, "u", position);
|
||||||
@ -607,7 +607,7 @@ g_menu_exporter_subscribe (GMenuExporter *exporter,
|
|||||||
g_menu_exporter_remote_new (exporter, 0);
|
g_menu_exporter_remote_new (exporter, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("(a(uuaa{sv}))"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("(a(uuaa{sv}))"));
|
||||||
|
|
||||||
g_variant_builder_open (&builder, G_VARIANT_TYPE ("a(uuaa{sv})"));
|
g_variant_builder_open (&builder, G_VARIANT_TYPE ("a(uuaa{sv})"));
|
||||||
|
|
||||||
@ -656,7 +656,7 @@ g_menu_exporter_report (GMenuExporter *exporter,
|
|||||||
{
|
{
|
||||||
GVariantBuilder builder;
|
GVariantBuilder builder;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE);
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE_TUPLE);
|
||||||
g_variant_builder_open (&builder, G_VARIANT_TYPE_ARRAY);
|
g_variant_builder_open (&builder, G_VARIANT_TYPE_ARRAY);
|
||||||
g_variant_builder_add_value (&builder, report);
|
g_variant_builder_add_value (&builder, report);
|
||||||
g_variant_builder_close (&builder);
|
g_variant_builder_close (&builder);
|
||||||
|
@ -343,7 +343,7 @@ g_nextstep_settings_backend_get_g_variant (id object,
|
|||||||
|
|
||||||
value_type = g_variant_type_value (g_variant_type_element (type));
|
value_type = g_variant_type_value (g_variant_type_element (type));
|
||||||
|
|
||||||
g_variant_builder_init (&builder, type);
|
g_variant_builder_init_static (&builder, type);
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||||
for(key in object)
|
for(key in object)
|
||||||
@ -384,7 +384,7 @@ g_nextstep_settings_backend_get_g_variant (id object,
|
|||||||
id value;
|
id value;
|
||||||
|
|
||||||
value_type = g_variant_type_element (type);
|
value_type = g_variant_type_element (type);
|
||||||
g_variant_builder_init (&builder, type);
|
g_variant_builder_init_static (&builder, type);
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
|
||||||
for(value in object)
|
for(value in object)
|
||||||
|
@ -767,7 +767,7 @@ g_notification_serialize_button (Button *button)
|
|||||||
{
|
{
|
||||||
GVariantBuilder builder;
|
GVariantBuilder builder;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}"));
|
||||||
|
|
||||||
g_variant_builder_add (&builder, "{sv}", "label", g_variant_new_string (button->label));
|
g_variant_builder_add (&builder, "{sv}", "label", g_variant_new_string (button->label));
|
||||||
g_variant_builder_add (&builder, "{sv}", "action", g_variant_new_string (button->action_name));
|
g_variant_builder_add (&builder, "{sv}", "action", g_variant_new_string (button->action_name));
|
||||||
@ -806,7 +806,7 @@ g_notification_serialize (GNotification *notification)
|
|||||||
{
|
{
|
||||||
GVariantBuilder builder;
|
GVariantBuilder builder;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}"));
|
||||||
|
|
||||||
if (notification->title)
|
if (notification->title)
|
||||||
g_variant_builder_add (&builder, "{sv}", "title", g_variant_new_string (notification->title));
|
g_variant_builder_add (&builder, "{sv}", "title", g_variant_new_string (notification->title));
|
||||||
@ -842,7 +842,7 @@ g_notification_serialize (GNotification *notification)
|
|||||||
GVariantBuilder actions_builder;
|
GVariantBuilder actions_builder;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
g_variant_builder_init (&actions_builder, G_VARIANT_TYPE ("aa{sv}"));
|
g_variant_builder_init_static (&actions_builder, G_VARIANT_TYPE ("aa{sv}"));
|
||||||
|
|
||||||
for (i = 0; i < notification->buttons->len; i++)
|
for (i = 0; i < notification->buttons->len; i++)
|
||||||
{
|
{
|
||||||
|
@ -95,7 +95,7 @@ g_openuri_portal_open_file (GFile *file,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_variant_builder_init (&opt_builder, G_VARIANT_TYPE_VARDICT);
|
g_variant_builder_init_static (&opt_builder, G_VARIANT_TYPE_VARDICT);
|
||||||
|
|
||||||
if (startup_id)
|
if (startup_id)
|
||||||
g_variant_builder_add (&opt_builder, "{sv}",
|
g_variant_builder_add (&opt_builder, "{sv}",
|
||||||
@ -306,7 +306,7 @@ g_openuri_portal_open_file_async (GFile *file,
|
|||||||
NULL);
|
NULL);
|
||||||
g_object_set_data (G_OBJECT (task), "signal-id", GINT_TO_POINTER (signal_id));
|
g_object_set_data (G_OBJECT (task), "signal-id", GINT_TO_POINTER (signal_id));
|
||||||
|
|
||||||
g_variant_builder_init (&opt_builder, G_VARIANT_TYPE_VARDICT);
|
g_variant_builder_init_static (&opt_builder, G_VARIANT_TYPE_VARDICT);
|
||||||
g_variant_builder_add (&opt_builder, "{sv}", "handle_token", g_variant_new_string (token));
|
g_variant_builder_add (&opt_builder, "{sv}", "handle_token", g_variant_new_string (token));
|
||||||
g_free (token);
|
g_free (token);
|
||||||
|
|
||||||
|
@ -410,7 +410,7 @@ g_settings_set_mapping (const GValue *value,
|
|||||||
fclass = g_type_class_peek (G_VALUE_TYPE (value));
|
fclass = g_type_class_peek (G_VALUE_TYPE (value));
|
||||||
flags = g_value_get_flags (value);
|
flags = g_value_get_flags (value);
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("as"));
|
||||||
while (flags)
|
while (flags)
|
||||||
{
|
{
|
||||||
flagsval = g_flags_get_first_value (fclass, flags);
|
flagsval = g_flags_get_first_value (fclass, flags);
|
||||||
|
@ -1381,7 +1381,7 @@ g_settings_schema_key_range_fixup (GSettingsSchemaKey *key,
|
|||||||
GVariant *child;
|
GVariant *child;
|
||||||
|
|
||||||
g_variant_iter_init (&iter, value);
|
g_variant_iter_init (&iter, value);
|
||||||
g_variant_builder_init (&builder, g_variant_get_type (value));
|
g_variant_builder_init_static (&builder, g_variant_get_type (value));
|
||||||
|
|
||||||
while ((child = g_variant_iter_next_value (&iter)))
|
while ((child = g_variant_iter_next_value (&iter)))
|
||||||
{
|
{
|
||||||
@ -1574,7 +1574,7 @@ g_settings_schema_key_from_flags (GSettingsSchemaKey *key,
|
|||||||
GVariantBuilder builder;
|
GVariantBuilder builder;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("as"));
|
||||||
|
|
||||||
for (i = 0; i < 32; i++)
|
for (i = 0; i < 32; i++)
|
||||||
if (value & (1u << i))
|
if (value & (1u << i))
|
||||||
|
@ -4790,7 +4790,7 @@ make_platform_data (GPid pid)
|
|||||||
{
|
{
|
||||||
GVariantBuilder builder;
|
GVariantBuilder builder;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY);
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE_ARRAY);
|
||||||
/* pid handles are never bigger than 2^24 as per
|
/* pid handles are never bigger than 2^24 as per
|
||||||
* https://docs.microsoft.com/en-us/windows/win32/sysinfo/kernel-objects,
|
* https://docs.microsoft.com/en-us/windows/win32/sysinfo/kernel-objects,
|
||||||
* so truncating to `int32` is valid.
|
* so truncating to `int32` is valid.
|
||||||
|
@ -272,7 +272,7 @@ strinfo_enumerate (const guint32 *strinfo,
|
|||||||
|
|
||||||
ptr += 4;
|
ptr += 4;
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE_STRING_ARRAY);
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE_STRING_ARRAY);
|
||||||
|
|
||||||
while (ptr < end)
|
while (ptr < end)
|
||||||
{
|
{
|
||||||
|
@ -1368,7 +1368,7 @@ test_dbus_activate (void)
|
|||||||
g_ptr_array_add (messages, g_steal_pointer (&message));
|
g_ptr_array_add (messages, g_steal_pointer (&message));
|
||||||
|
|
||||||
/* With some platform data */
|
/* With some platform data */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}"));
|
||||||
g_variant_builder_add (&builder, "{sv}", "cwd", g_variant_new_bytestring ("/home/henry"));
|
g_variant_builder_add (&builder, "{sv}", "cwd", g_variant_new_bytestring ("/home/henry"));
|
||||||
|
|
||||||
message = g_dbus_message_new_method_call ("org.gtk.TestApplication.Activate",
|
message = g_dbus_message_new_method_call ("org.gtk.TestApplication.Activate",
|
||||||
@ -1446,7 +1446,7 @@ test_dbus_open (void)
|
|||||||
messages = g_ptr_array_new_with_free_func (g_object_unref);
|
messages = g_ptr_array_new_with_free_func (g_object_unref);
|
||||||
|
|
||||||
/* Via org.gtk.Application */
|
/* Via org.gtk.Application */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("as"));
|
||||||
g_variant_builder_add (&builder, "s", "file:///home/henry/test");
|
g_variant_builder_add (&builder, "s", "file:///home/henry/test");
|
||||||
|
|
||||||
message = g_dbus_message_new_method_call ("org.gtk.TestApplication.Open",
|
message = g_dbus_message_new_method_call ("org.gtk.TestApplication.Open",
|
||||||
@ -1457,7 +1457,7 @@ test_dbus_open (void)
|
|||||||
g_ptr_array_add (messages, g_steal_pointer (&message));
|
g_ptr_array_add (messages, g_steal_pointer (&message));
|
||||||
|
|
||||||
/* Via org.freedesktop.Application (which has no hint parameter) */
|
/* Via org.freedesktop.Application (which has no hint parameter) */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("as"));
|
||||||
g_variant_builder_add (&builder, "s", "file:///home/henry/test");
|
g_variant_builder_add (&builder, "s", "file:///home/henry/test");
|
||||||
|
|
||||||
message = g_dbus_message_new_method_call ("org.gtk.TestApplication.Open",
|
message = g_dbus_message_new_method_call ("org.gtk.TestApplication.Open",
|
||||||
@ -1468,11 +1468,11 @@ test_dbus_open (void)
|
|||||||
g_ptr_array_add (messages, g_steal_pointer (&message));
|
g_ptr_array_add (messages, g_steal_pointer (&message));
|
||||||
|
|
||||||
/* With some platform data and more than one file */
|
/* With some platform data and more than one file */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("as"));
|
||||||
g_variant_builder_add (&builder, "s", "file:///home/henry/test");
|
g_variant_builder_add (&builder, "s", "file:///home/henry/test");
|
||||||
g_variant_builder_add (&builder, "s", "file:///home/henry/test2");
|
g_variant_builder_add (&builder, "s", "file:///home/henry/test2");
|
||||||
|
|
||||||
g_variant_builder_init (&builder2, G_VARIANT_TYPE ("a{sv}"));
|
g_variant_builder_init_static (&builder2, G_VARIANT_TYPE ("a{sv}"));
|
||||||
g_variant_builder_add (&builder2, "{sv}", "cwd", g_variant_new_bytestring ("/home/henry"));
|
g_variant_builder_add (&builder2, "{sv}", "cwd", g_variant_new_bytestring ("/home/henry"));
|
||||||
|
|
||||||
message = g_dbus_message_new_method_call ("org.gtk.TestApplication.Open",
|
message = g_dbus_message_new_method_call ("org.gtk.TestApplication.Open",
|
||||||
@ -1550,7 +1550,7 @@ test_dbus_command_line (void)
|
|||||||
messages = g_ptr_array_new_with_free_func (g_object_unref);
|
messages = g_ptr_array_new_with_free_func (g_object_unref);
|
||||||
|
|
||||||
/* Via org.gtk.Application */
|
/* Via org.gtk.Application */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("aay"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("aay"));
|
||||||
g_variant_builder_add (&builder, "^ay", "test-program");
|
g_variant_builder_add (&builder, "^ay", "test-program");
|
||||||
g_variant_builder_add (&builder, "^ay", "--open");
|
g_variant_builder_add (&builder, "^ay", "--open");
|
||||||
g_variant_builder_add (&builder, "^ay", "/path/to/something");
|
g_variant_builder_add (&builder, "^ay", "/path/to/something");
|
||||||
@ -1565,12 +1565,12 @@ test_dbus_command_line (void)
|
|||||||
g_ptr_array_add (messages, g_steal_pointer (&message));
|
g_ptr_array_add (messages, g_steal_pointer (&message));
|
||||||
|
|
||||||
/* With platform data */
|
/* With platform data */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("aay"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("aay"));
|
||||||
g_variant_builder_add (&builder, "^ay", "test-program");
|
g_variant_builder_add (&builder, "^ay", "test-program");
|
||||||
g_variant_builder_add (&builder, "^ay", "--open");
|
g_variant_builder_add (&builder, "^ay", "--open");
|
||||||
g_variant_builder_add (&builder, "^ay", "/path/to/something");
|
g_variant_builder_add (&builder, "^ay", "/path/to/something");
|
||||||
|
|
||||||
g_variant_builder_init (&builder2, G_VARIANT_TYPE ("a{sv}"));
|
g_variant_builder_init_static (&builder2, G_VARIANT_TYPE ("a{sv}"));
|
||||||
g_variant_builder_add (&builder2, "{sv}", "cwd", g_variant_new_bytestring ("/home"));
|
g_variant_builder_add (&builder2, "{sv}", "cwd", g_variant_new_bytestring ("/home"));
|
||||||
g_variant_builder_add_parsed (&builder2, "{'environ', <@aay [ b'HOME=/home/bloop', b'PATH=/blah']>}");
|
g_variant_builder_add_parsed (&builder2, "{'environ', <@aay [ b'HOME=/home/bloop', b'PATH=/blah']>}");
|
||||||
g_variant_builder_add_parsed (&builder2, "{'options', <{'a': <@u 32>, 'b': <'bloop'>}>}");
|
g_variant_builder_add_parsed (&builder2, "{'options', <{'a': <@u 32>, 'b': <'bloop'>}>}");
|
||||||
@ -1585,12 +1585,12 @@ test_dbus_command_line (void)
|
|||||||
g_ptr_array_add (messages, g_steal_pointer (&message));
|
g_ptr_array_add (messages, g_steal_pointer (&message));
|
||||||
|
|
||||||
/* With invalid typed platform data */
|
/* With invalid typed platform data */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("aay"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("aay"));
|
||||||
g_variant_builder_add (&builder, "^ay", "test-program");
|
g_variant_builder_add (&builder, "^ay", "test-program");
|
||||||
g_variant_builder_add (&builder, "^ay", "--open");
|
g_variant_builder_add (&builder, "^ay", "--open");
|
||||||
g_variant_builder_add (&builder, "^ay", "/path/to/something");
|
g_variant_builder_add (&builder, "^ay", "/path/to/something");
|
||||||
|
|
||||||
g_variant_builder_init (&builder2, G_VARIANT_TYPE ("a{sv}"));
|
g_variant_builder_init_static (&builder2, G_VARIANT_TYPE ("a{sv}"));
|
||||||
g_variant_builder_add (&builder2, "{sv}", "cwd", g_variant_new_string ("/home should be a bytestring"));
|
g_variant_builder_add (&builder2, "{sv}", "cwd", g_variant_new_string ("/home should be a bytestring"));
|
||||||
g_variant_builder_add_parsed (&builder2, "{'environ', <['HOME=should be a bytestring', 'PATH=this also']>}");
|
g_variant_builder_add_parsed (&builder2, "{'environ', <['HOME=should be a bytestring', 'PATH=this also']>}");
|
||||||
g_variant_builder_add_parsed (&builder2, "{'options', <['should be a', 'dict']>}");
|
g_variant_builder_add_parsed (&builder2, "{'options', <['should be a', 'dict']>}");
|
||||||
@ -1673,7 +1673,7 @@ test_dbus_command_line_done (void)
|
|||||||
|
|
||||||
g_test_summary ("Test that GDBusCommandLine.done() works");
|
g_test_summary ("Test that GDBusCommandLine.done() works");
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("aay"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("aay"));
|
||||||
g_variant_builder_add (&builder, "^ay", "test-program");
|
g_variant_builder_add (&builder, "^ay", "test-program");
|
||||||
g_variant_builder_add (&builder, "^ay", "/path/to/something");
|
g_variant_builder_add (&builder, "^ay", "/path/to/something");
|
||||||
|
|
||||||
@ -1748,7 +1748,7 @@ test_dbus_activate_action (void)
|
|||||||
messages[0].n_expected_activations = 1;
|
messages[0].n_expected_activations = 1;
|
||||||
|
|
||||||
/* Action with parameter */
|
/* Action with parameter */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("av"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("av"));
|
||||||
g_variant_builder_add (&builder, "v", g_variant_new_string ("spanish"));
|
g_variant_builder_add (&builder, "v", g_variant_new_string ("spanish"));
|
||||||
|
|
||||||
messages[1].message = g_dbus_message_new_method_call ("org.gtk.TestApplication.ActivateAction",
|
messages[1].message = g_dbus_message_new_method_call ("org.gtk.TestApplication.ActivateAction",
|
||||||
@ -1759,7 +1759,7 @@ test_dbus_activate_action (void)
|
|||||||
messages[1].n_expected_activations = 1;
|
messages[1].n_expected_activations = 1;
|
||||||
|
|
||||||
/* Action with unexpected parameter */
|
/* Action with unexpected parameter */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("av"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("av"));
|
||||||
g_variant_builder_add (&builder, "v", g_variant_new_string ("should not be passed"));
|
g_variant_builder_add (&builder, "v", g_variant_new_string ("should not be passed"));
|
||||||
|
|
||||||
messages[2].message = g_dbus_message_new_method_call ("org.gtk.TestApplication.ActivateAction",
|
messages[2].message = g_dbus_message_new_method_call ("org.gtk.TestApplication.ActivateAction",
|
||||||
@ -1778,7 +1778,7 @@ test_dbus_activate_action (void)
|
|||||||
messages[3].n_expected_activations = 0;
|
messages[3].n_expected_activations = 0;
|
||||||
|
|
||||||
/* Action with wrong parameter type */
|
/* Action with wrong parameter type */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("av"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("av"));
|
||||||
g_variant_builder_add (&builder, "v", g_variant_new_uint32 (42));
|
g_variant_builder_add (&builder, "v", g_variant_new_uint32 (42));
|
||||||
|
|
||||||
messages[4].message = g_dbus_message_new_method_call ("org.gtk.TestApplication.ActivateAction",
|
messages[4].message = g_dbus_message_new_method_call ("org.gtk.TestApplication.ActivateAction",
|
||||||
@ -1797,7 +1797,7 @@ test_dbus_activate_action (void)
|
|||||||
messages[5].n_expected_activations = 0;
|
messages[5].n_expected_activations = 0;
|
||||||
|
|
||||||
/* Action with tuple as parameter given as two items to the interface */
|
/* Action with tuple as parameter given as two items to the interface */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("av"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("av"));
|
||||||
g_variant_builder_add (&builder, "v", g_variant_new_string ("first"));
|
g_variant_builder_add (&builder, "v", g_variant_new_string ("first"));
|
||||||
g_variant_builder_add (&builder, "v", g_variant_new_string ("second"));
|
g_variant_builder_add (&builder, "v", g_variant_new_string ("second"));
|
||||||
|
|
||||||
@ -1810,7 +1810,7 @@ test_dbus_activate_action (void)
|
|||||||
messages[6].n_expected_activations = 1;
|
messages[6].n_expected_activations = 1;
|
||||||
|
|
||||||
/* Action with tuple as parameter given as two items to the interface but with a wrong type */
|
/* Action with tuple as parameter given as two items to the interface but with a wrong type */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("av"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("av"));
|
||||||
g_variant_builder_add (&builder, "v", g_variant_new_string ("first"));
|
g_variant_builder_add (&builder, "v", g_variant_new_string ("first"));
|
||||||
g_variant_builder_add (&builder, "v", g_variant_new_uint32 (42));
|
g_variant_builder_add (&builder, "v", g_variant_new_uint32 (42));
|
||||||
|
|
||||||
@ -1822,7 +1822,7 @@ test_dbus_activate_action (void)
|
|||||||
messages[7].n_expected_activations = 0;
|
messages[7].n_expected_activations = 0;
|
||||||
|
|
||||||
/* Action with tuple as parameter given as a single item to the interface */
|
/* Action with tuple as parameter given as a single item to the interface */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("av"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("av"));
|
||||||
g_variant_builder_add (&builder, "v", g_variant_new ("(ss)", "first", "second"));
|
g_variant_builder_add (&builder, "v", g_variant_new ("(ss)", "first", "second"));
|
||||||
|
|
||||||
messages[8].message = g_dbus_message_new_method_call ("org.gtk.TestApplication.ActivateAction",
|
messages[8].message = g_dbus_message_new_method_call ("org.gtk.TestApplication.ActivateAction",
|
||||||
@ -1833,7 +1833,7 @@ test_dbus_activate_action (void)
|
|||||||
messages[8].n_expected_activations = 1;
|
messages[8].n_expected_activations = 1;
|
||||||
|
|
||||||
/* Action with tuple as parameter given as a single item to the interface but with additional items */
|
/* Action with tuple as parameter given as a single item to the interface but with additional items */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("av"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("av"));
|
||||||
g_variant_builder_add (&builder, "v", g_variant_new ("(ss)", "first", "second"));
|
g_variant_builder_add (&builder, "v", g_variant_new ("(ss)", "first", "second"));
|
||||||
g_variant_builder_add (&builder, "v", g_variant_new_uint32 (42));
|
g_variant_builder_add (&builder, "v", g_variant_new_uint32 (42));
|
||||||
g_variant_builder_add (&builder, "v", g_variant_new_uint32 (42));
|
g_variant_builder_add (&builder, "v", g_variant_new_uint32 (42));
|
||||||
@ -1846,7 +1846,7 @@ test_dbus_activate_action (void)
|
|||||||
messages[9].n_expected_activations = 0;
|
messages[9].n_expected_activations = 0;
|
||||||
|
|
||||||
/* Action with tuple with single item as parameter */
|
/* Action with tuple with single item as parameter */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("av"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("av"));
|
||||||
g_variant_builder_add (&builder, "v", g_variant_new ("(s)", "first"));
|
g_variant_builder_add (&builder, "v", g_variant_new ("(s)", "first"));
|
||||||
|
|
||||||
messages[10].message = g_dbus_message_new_method_call ("org.gtk.TestApplication.ActivateAction",
|
messages[10].message = g_dbus_message_new_method_call ("org.gtk.TestApplication.ActivateAction",
|
||||||
@ -1857,7 +1857,7 @@ test_dbus_activate_action (void)
|
|||||||
messages[10].n_expected_activations = 1;
|
messages[10].n_expected_activations = 1;
|
||||||
|
|
||||||
/* Action with tuple with single item as parameter with additional items */
|
/* Action with tuple with single item as parameter with additional items */
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("av"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("av"));
|
||||||
g_variant_builder_add (&builder, "v", g_variant_new ("(s)", "first"));
|
g_variant_builder_add (&builder, "v", g_variant_new ("(s)", "first"));
|
||||||
g_variant_builder_add (&builder, "v", g_variant_new_uint32 (42));
|
g_variant_builder_add (&builder, "v", g_variant_new_uint32 (42));
|
||||||
g_variant_builder_add (&builder, "v", g_variant_new_uint32 (43));
|
g_variant_builder_add (&builder, "v", g_variant_new_uint32 (43));
|
||||||
|
@ -129,7 +129,7 @@ mock_interface_get_properties (GDBusInterfaceSkeleton *interface)
|
|||||||
info = g_dbus_interface_skeleton_get_info (interface);
|
info = g_dbus_interface_skeleton_get_info (interface);
|
||||||
vtable = g_dbus_interface_skeleton_get_vtable (interface);
|
vtable = g_dbus_interface_skeleton_get_vtable (interface);
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("a{sv}"));
|
||||||
for (n = 0; info->properties[n] != NULL; n++)
|
for (n = 0; info->properties[n] != NULL; n++)
|
||||||
{
|
{
|
||||||
if (info->properties[n]->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
|
if (info->properties[n]->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
|
||||||
|
@ -1262,7 +1262,7 @@ test_message_serialize_double_array (void)
|
|||||||
|
|
||||||
g_test_bug ("https://bugzilla.gnome.org/show_bug.cgi?id=732754");
|
g_test_bug ("https://bugzilla.gnome.org/show_bug.cgi?id=732754");
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("ad"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("ad"));
|
||||||
g_variant_builder_add (&builder, "d", (gdouble)0.0);
|
g_variant_builder_add (&builder, "d", (gdouble)0.0);
|
||||||
g_variant_builder_add (&builder, "d", (gdouble)8.0);
|
g_variant_builder_add (&builder, "d", (gdouble)8.0);
|
||||||
g_variant_builder_add (&builder, "d", (gdouble)22.0);
|
g_variant_builder_add (&builder, "d", (gdouble)22.0);
|
||||||
@ -1639,7 +1639,7 @@ test_message_parse_truncated (void)
|
|||||||
g_test_bug ("https://gitlab.gnome.org/GNOME/glib/-/issues/2528");
|
g_test_bug ("https://gitlab.gnome.org/GNOME/glib/-/issues/2528");
|
||||||
|
|
||||||
message = g_dbus_message_new ();
|
message = g_dbus_message_new ();
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("(asbynqiuxtd)"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("(asbynqiuxtd)"));
|
||||||
g_variant_builder_open (&builder, G_VARIANT_TYPE ("as"));
|
g_variant_builder_open (&builder, G_VARIANT_TYPE ("as"));
|
||||||
g_variant_builder_add (&builder, "s", "fourtytwo");
|
g_variant_builder_add (&builder, "s", "fourtytwo");
|
||||||
g_variant_builder_close (&builder);
|
g_variant_builder_close (&builder);
|
||||||
@ -1747,7 +1747,7 @@ test_message_serialize_empty_structure (void)
|
|||||||
g_test_bug ("https://gitlab.gnome.org/GNOME/glib/-/issues/2557");
|
g_test_bug ("https://gitlab.gnome.org/GNOME/glib/-/issues/2557");
|
||||||
|
|
||||||
message = g_dbus_message_new ();
|
message = g_dbus_message_new ();
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("(a())"));
|
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("(a())"));
|
||||||
g_variant_builder_open (&builder, G_VARIANT_TYPE ("a()"));
|
g_variant_builder_open (&builder, G_VARIANT_TYPE ("a()"));
|
||||||
g_variant_builder_add (&builder, "()");
|
g_variant_builder_add (&builder, "()");
|
||||||
g_variant_builder_close (&builder);
|
g_variant_builder_close (&builder);
|
||||||
|
@ -327,7 +327,7 @@ handle_method_call (GDBusConnection *connection,
|
|||||||
gsize i, j;
|
gsize i, j;
|
||||||
GVariantBuilder ret;
|
GVariantBuilder ret;
|
||||||
|
|
||||||
g_variant_builder_init (&ret, G_VARIANT_TYPE ("(ayabanaqaiauaxatad)"));
|
g_variant_builder_init_static (&ret, G_VARIANT_TYPE ("(ayabanaqaiauaxatad)"));
|
||||||
|
|
||||||
v = g_variant_get_child_value (parameters, 0);
|
v = g_variant_get_child_value (parameters, 0);
|
||||||
bytes = g_variant_get_fixed_array (v, &n_elts, 1);
|
bytes = g_variant_get_fixed_array (v, &n_elts, 1);
|
||||||
@ -423,7 +423,7 @@ handle_method_call (GDBusConnection *connection,
|
|||||||
const gchar *s;
|
const gchar *s;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
g_variant_builder_init (&ret, G_VARIANT_TYPE ("(asaoag)"));
|
g_variant_builder_init_static (&ret, G_VARIANT_TYPE ("(asaoag)"));
|
||||||
g_variant_get (parameters, "(asaoag)", &iter1, &iter2, &iter3);
|
g_variant_get (parameters, "(asaoag)", &iter1, &iter2, &iter3);
|
||||||
|
|
||||||
g_variant_builder_open (&ret, G_VARIANT_TYPE ("as"));
|
g_variant_builder_open (&ret, G_VARIANT_TYPE ("as"));
|
||||||
@ -479,7 +479,7 @@ handle_method_call (GDBusConnection *connection,
|
|||||||
gdouble d1, d2;
|
gdouble d1, d2;
|
||||||
gchar *s1, *s2;
|
gchar *s1, *s2;
|
||||||
|
|
||||||
g_variant_builder_init (&ret, G_VARIANT_TYPE ("(a{yy}a{bb}a{nn}a{qq}a{ii}a{uu}a{xx}a{tt}a{dd}a{ss}a{oo}a{gg})"));
|
g_variant_builder_init_static (&ret, G_VARIANT_TYPE ("(a{yy}a{bb}a{nn}a{qq}a{ii}a{uu}a{xx}a{tt}a{dd}a{ss}a{oo}a{gg})"));
|
||||||
|
|
||||||
g_variant_builder_open (&ret, G_VARIANT_TYPE ("a{yy}"));
|
g_variant_builder_open (&ret, G_VARIANT_TYPE ("a{yy}"));
|
||||||
v = g_variant_get_child_value (parameters, 0);
|
v = g_variant_get_child_value (parameters, 0);
|
||||||
@ -617,7 +617,7 @@ handle_method_call (GDBusConnection *connection,
|
|||||||
|
|
||||||
desc_ret = g_strconcat (desc, "... in bed!", NULL);
|
desc_ret = g_strconcat (desc, "... in bed!", NULL);
|
||||||
|
|
||||||
g_variant_builder_init (&ret1, G_VARIANT_TYPE ("ay"));
|
g_variant_builder_init_static (&ret1, G_VARIANT_TYPE ("ay"));
|
||||||
iter = g_variant_iter_copy (iter1);
|
iter = g_variant_iter_copy (iter1);
|
||||||
while (g_variant_iter_loop (iter1, "y", &v))
|
while (g_variant_iter_loop (iter1, "y", &v))
|
||||||
g_variant_builder_add (&ret1, "y", v);
|
g_variant_builder_add (&ret1, "y", v);
|
||||||
@ -626,7 +626,7 @@ handle_method_call (GDBusConnection *connection,
|
|||||||
g_variant_iter_free (iter);
|
g_variant_iter_free (iter);
|
||||||
g_variant_iter_free (iter1);
|
g_variant_iter_free (iter1);
|
||||||
|
|
||||||
g_variant_builder_init (&ret2, G_VARIANT_TYPE ("a{ss}"));
|
g_variant_builder_init_static (&ret2, G_VARIANT_TYPE ("a{ss}"));
|
||||||
while (g_variant_iter_loop (iter1, "ss", &s1, &s2))
|
while (g_variant_iter_loop (iter1, "ss", &s1, &s2))
|
||||||
{
|
{
|
||||||
gchar *tmp;
|
gchar *tmp;
|
||||||
|
Loading…
Reference in New Issue
Block a user