[gnome-bluetooth/wip/hadess/btd-restart-fixes: 9/13] lib: Split off notifying about default-adapter* props




commit 9570f448e8f1e3d95756ed13cb08d13d6220b776
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Dec 8 23:58:18 2021 +0100

    lib: Split off notifying about default-adapter* props

 lib/bluetooth-client.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index d39171b2..732d1ffc 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -509,6 +509,16 @@ adapter_notify_cb (Adapter1       *adapter,
        }
 }
 
+static void
+notify_default_adapter_props (BluetoothClient *client)
+{
+       g_object_notify (G_OBJECT (client), "default-adapter");
+       g_object_notify (G_OBJECT (client), "default-adapter-address");
+       g_object_notify (G_OBJECT (client), "default-adapter-powered");
+       g_object_notify (G_OBJECT (client), "default-adapter-setup-mode");
+       g_object_notify (G_OBJECT (client), "default-adapter-name");
+}
+
 static void
 default_adapter_changed (GDBusObjectManager   *manager,
                         GDBusProxy           *adapter,
@@ -527,11 +537,7 @@ default_adapter_changed (GDBusObjectManager   *manager,
        add_devices_to_list_store (client);
 
        g_debug ("New default adapter so invalidating all the default-adapter* properties");
-       g_object_notify (G_OBJECT (client), "default-adapter");
-       g_object_notify (G_OBJECT (client), "default-adapter-address");
-       g_object_notify (G_OBJECT (client), "default-adapter-powered");
-       g_object_notify (G_OBJECT (client), "default-adapter-setup-mode");
-       g_object_notify (G_OBJECT (client), "default-adapter-name");
+       notify_default_adapter_props (client);
 
        powered = adapter1_get_powered (client->default_adapter);
        if (!powered)


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