[gnome-bluetooth/wip/hadess/bluetooth-off-turn-off] lib: Add debug on property changes



commit 18f17c248c303e59f79b900ac1d6145afdd71b51
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Nov 25 18:00:15 2021 +0100

    lib: Add debug on property changes

 lib/bluetooth-client.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index 7a0dbe4b..618a5c06 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -329,6 +329,9 @@ device_notify_cb (Device1         *device,
        if (get_iter_from_proxy (priv->store, &iter, G_DBUS_PROXY (device)) == FALSE)
                return;
 
+       g_debug ("Property '%s' changed on device '%s'",
+                property, g_dbus_proxy_get_object_path (G_DBUS_PROXY (device)));
+
        if (g_strcmp0 (property, "name") == 0) {
                const gchar *name = device1_get_name (device);
 
@@ -548,6 +551,7 @@ default_adapter_changed (GDBusObjectManager   *manager,
        }
 
        if (powered) {
+               g_debug ("New default adapter is powered, so invalidating all the default-adapter* 
properties");
                g_object_notify (G_OBJECT (client), "default-adapter");
                g_object_notify (G_OBJECT (client), "default-adapter-powered");
                g_object_notify (G_OBJECT (client), "default-adapter-discoverable");
@@ -581,6 +585,10 @@ adapter_notify_cb (Adapter1       *adapter,
        gtk_tree_model_get (GTK_TREE_MODEL(priv->store), &iter,
                            BLUETOOTH_COLUMN_DEFAULT, &is_default, -1);
 
+       g_debug ("Property '%s' changed on %sadapter '%s'", property,
+                is_default ? "default " : "",
+                g_dbus_proxy_get_object_path (G_DBUS_PROXY (adapter)));
+
        if (g_strcmp0 (property, "alias") == 0) {
                const gchar *alias = adapter1_get_alias (adapter);
 
@@ -606,6 +614,7 @@ adapter_notify_cb (Adapter1       *adapter,
                                    BLUETOOTH_COLUMN_POWERED, powered, -1);
 
                if (is_default && powered) {
+                       g_debug ("Default adapter is powered, so invalidating all the default-adapter* 
properties");
                        g_object_notify (G_OBJECT (client), "default-adapter");
                        g_object_notify (G_OBJECT (client), "default-adapter-discoverable");
                        g_object_notify (G_OBJECT (client), "default-adapter-discovering");


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