[gnome-bluetooth] lib: Print "default-adapter-discovering" when it changes



commit 6493bd238c7af172daa5de4f57923d4151a43722
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Nov 28 16:45:33 2013 +0100

    lib: Print "default-adapter-discovering" when it changes
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719564

 lib/test-client.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/lib/test-client.c b/lib/test-client.c
index 7bd929d..402f58e 100644
--- a/lib/test-client.c
+++ b/lib/test-client.c
@@ -284,6 +284,17 @@ default_adapter_powered_changed (GObject    *gobject,
        g_message ("Default adapter is %s", powered ? "powered" : "switched off");
 }
 
+static void
+default_adapter_discovering_changed (GObject    *gobject,
+                                    GParamSpec *pspec,
+                                    gpointer    user_data)
+{
+       gboolean discovering;
+
+       g_object_get (G_OBJECT (gobject), "default-adapter-discovering", &discovering, NULL);
+       g_message ("Default adapter is %s", discovering ? "discovering" : "not discovering");
+}
+
 int main(int argc, char *argv[])
 {
        GLogLevelFlags fatal_mask;
@@ -299,6 +310,8 @@ int main(int argc, char *argv[])
                          G_CALLBACK (default_adapter_changed), NULL);
        g_signal_connect (G_OBJECT (client), "notify::default-adapter-powered",
                          G_CALLBACK (default_adapter_powered_changed), NULL);
+       g_signal_connect (G_OBJECT (client), "notify::default-adapter-discovering",
+                         G_CALLBACK (default_adapter_discovering_changed), NULL);
 
        default_adapter_changed (G_OBJECT (client), NULL, NULL);
        default_adapter_powered_changed (G_OBJECT (client), NULL, NULL);


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