From d37af2bd047308dc91f343bb58a1ac15d1f01d76 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Mon, 16 Dec 2013 11:42:13 +0900 Subject: [PATCH] GDBusActionGroup: Allow NULL bus name for peer-to-peer connection https://bugzilla.gnome.org/show_bug.cgi?id=720380 --- gio/gdbusactiongroup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gio/gdbusactiongroup.c b/gio/gdbusactiongroup.c index 0acee36a9..894b482bd 100644 --- a/gio/gdbusactiongroup.c +++ b/gio/gdbusactiongroup.c @@ -475,7 +475,8 @@ g_dbus_action_group_iface_init (GActionGroupInterface *iface) /** * g_dbus_action_group_get: * @connection: A #GDBusConnection - * @bus_name: the bus name which exports the action group + * @bus_name: (nullable): the bus name which exports the action + * group or %NULL if @connection is not a message bus connection * @object_path: the object path at which the action group is exported * * Obtains a #GDBusActionGroup for the action group which is exported at @@ -503,6 +504,8 @@ g_dbus_action_group_get (GDBusConnection *connection, { GDBusActionGroup *group; + g_return_val_if_fail (bus_name != NULL || g_dbus_connection_get_unique_name (connection) == NULL, NULL); + group = g_object_new (G_TYPE_DBUS_ACTION_GROUP, NULL); group->connection = g_object_ref (connection); group->bus_name = g_strdup (bus_name);