mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
GDBusObjectManagerServer: Allow setting :connection property
.. and add a C setter to do this. Also make the C getter return a reference since the property may be set from another thread. Also change the constructor to _not_ take a GDBusConnection since this is something you almost always want to do _after_ creating it. The API/ABI break is fine as there has never been a GLib release with this type. https://bugzilla.gnome.org/show_bug.cgi?id=648959 Signed-off-by: David Zeuthen <davidz@redhat.com>
This commit is contained in:
@@ -68,7 +68,7 @@ on_bus_acquired (GDBusConnection *connection,
|
||||
g_print ("Acquired a message bus connection\n");
|
||||
|
||||
/* Create a new org.freedesktop.DBus.ObjectManager rooted at /example/Animals */
|
||||
manager = g_dbus_object_manager_server_new (connection, "/example/Animals");
|
||||
manager = g_dbus_object_manager_server_new ("/example/Animals");
|
||||
|
||||
for (n = 0; n < 10; n++)
|
||||
{
|
||||
@@ -111,6 +111,9 @@ on_bus_acquired (GDBusConnection *connection,
|
||||
g_dbus_object_manager_server_export (manager, G_DBUS_OBJECT_SKELETON (object));
|
||||
g_object_unref (object);
|
||||
}
|
||||
|
||||
/* Export all objects */
|
||||
g_dbus_object_manager_server_set_connection (manager, connection);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user