[gnome-bluetooth] properties: Avoid loops when setting discoverable



commit a113375142fd524c1196774a527800bb884224f0
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Oct 14 15:37:31 2011 +0100

    properties: Avoid loops when setting discoverable

 properties/cc-bluetooth-panel.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/properties/cc-bluetooth-panel.c b/properties/cc-bluetooth-panel.c
index d8e3f77..7e7c538 100644
--- a/properties/cc-bluetooth-panel.c
+++ b/properties/cc-bluetooth-panel.c
@@ -498,13 +498,19 @@ browse_callback (GtkButton        *button,
 }
 
 /* Visibility/Discoverable */
+static void discoverable_changed (BluetoothClient  *client,
+				  GParamSpec       *spec,
+				  CcBluetoothPanel *self);
+
 static void
 switch_discoverable_active_changed (GtkSwitch        *button,
 				    GParamSpec       *spec,
 				    CcBluetoothPanel *self)
 {
+	g_signal_handlers_block_by_func (self->priv->client, discoverable_changed, self);
 	g_object_set (G_OBJECT (self->priv->client), "default-adapter-discoverable",
 		      gtk_switch_get_active (button), NULL);
+	g_signal_handlers_unblock_by_func (self->priv->client, discoverable_changed, self);
 }
 
 static void



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