[gnome-bluetooth] lib: Fix "default-adapter-discoverable" property



commit 6f71048369f1a534768b219c3f3c02a7a2ea3183
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Nov 28 16:46:06 2013 +0100

    lib: Fix "default-adapter-discoverable" property
    
    Which wasn't getting updated when the default-adapter changed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719564

 lib/bluetooth-client.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index 7149dc6..1f19ef3 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -534,6 +534,7 @@ default_adapter_changed (ObjectManager   *manager,
                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");
+               g_object_notify (G_OBJECT (client), "default-adapter-discovering");
                return;
        }
 
@@ -576,9 +577,14 @@ adapter_g_properties_changed (GDBusProxy      *adapter,
                        notify = TRUE;
                } else if (g_str_equal (property, "Discovering") == TRUE) {
                        gboolean discovering = g_variant_get_boolean (v);
+                       gboolean is_default;
 
                        gtk_tree_store_set (priv->store, &iter,
                                            BLUETOOTH_COLUMN_DISCOVERING, discovering, -1);
+                       gtk_tree_model_get (GTK_TREE_MODEL(priv->store), &iter,
+                                           BLUETOOTH_COLUMN_DEFAULT, &is_default, -1);
+                       if (is_default != FALSE)
+                               g_object_notify (G_OBJECT (client), "default-adapter-discovering");
                        notify = TRUE;
                } else if (g_str_equal (property, "Powered") == TRUE) {
                        gboolean powered = g_variant_get_boolean (v);
@@ -592,6 +598,7 @@ adapter_g_properties_changed (GDBusProxy      *adapter,
                                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");
+                               g_object_notify (G_OBJECT (client), "default-adapter-discovering");
                        }
                        notify = TRUE;
                } else if (g_str_equal (property, "Discoverable") == TRUE) {
@@ -722,6 +729,7 @@ adapter_removed (ObjectManager   *manager,
                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");
+               g_object_notify (G_OBJECT (client), "default-adapter-discovering");
        }
 }
 


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