[gnome-bluetooth/wip/hadess/btd-restart-fixes: 1/10] lib: Add debug to adapter's "notify" callback




commit cfdbdbe9ee546c0e5fb024f486eb575b8a1954a2
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Dec 8 16:22:33 2021 +0100

    lib: Add debug to adapter's "notify" callback

 lib/bluetooth-client.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index d73eb4bc..bdc136cf 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -484,9 +484,18 @@ adapter_notify_cb (Adapter1       *adapter,
        const char *default_adapter_path;
 
        adapter_path = g_dbus_proxy_get_object_path (G_DBUS_PROXY (adapter));
+       if (client->default_adapter == NULL) {
+               g_debug ("Property '%s' changed on adapter '%s', but default adapter not set yet",
+                        property, adapter_path);
+               return;
+       }
+
        default_adapter_path = g_dbus_proxy_get_object_path (G_DBUS_PROXY (client->default_adapter));
-       if (g_strcmp0 (default_adapter_path, adapter_path) != 0)
+       if (g_strcmp0 (default_adapter_path, adapter_path) != 0) {
+               g_debug ("Ignoring property '%s' change on non-default adapter %s",
+                          property, adapter_path);
                return;
+       }
 
        g_debug ("Property '%s' changed on default adapter '%s'", property, adapter_path);
 


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