[gnome-bluetooth/wip/hadess/btd-restart-fixes: 5/10] lib: Split off notifying about default-adapter* props
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth/wip/hadess/btd-restart-fixes: 5/10] lib: Split off notifying about default-adapter* props
- Date: Thu, 9 Dec 2021 13:08:34 +0000 (UTC)
commit 67c5220cbb9ed7cea3cebd18dbe765cd94924392
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]