[glib] GDBusActionGroup: Allow NULL bus name for peer-to-peer connection



commit d37af2bd047308dc91f343bb58a1ac15d1f01d76
Author: Daiki Ueno <ueno unixuser org>
Date:   Mon Dec 16 11:42:13 2013 +0900

    GDBusActionGroup: Allow NULL bus name for peer-to-peer connection
    
    https://bugzilla.gnome.org/show_bug.cgi?id=720380

 gio/gdbusactiongroup.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gio/gdbusactiongroup.c b/gio/gdbusactiongroup.c
index 0acee36..894b482 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]