[gnome-bluetooth/meego] Remove the previous visiblity timer before starting a new one



commit 90763793fc752e54c2c438b220e4f0f941574df7
Author: Raul Gutierrez Segales <rgs collabora co uk>
Date:   Fri Jul 1 12:05:31 2011 +0100

    Remove the previous visiblity timer before starting a new one
    
    Previously, to fix BMC#186, we added calls to remove the
    visibility timer when bluetooth is turned off. But that didn't
    handle the case when the panel was re-activated so a new timer
    is instantiated without removing the previous one.
    
    Fixes: https://bugs.meego.com/show_bug.cgi?id=19220

 moblin/moblin-panel.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/moblin/moblin-panel.c b/moblin/moblin-panel.c
index 07862b7..a699d68 100644
--- a/moblin/moblin-panel.c
+++ b/moblin/moblin-panel.c
@@ -147,6 +147,7 @@ static void set_current_page (MoblinPanel *self, MoblinPages page);
 static void create_callback (BluetoothClient *client, const gchar *path, const GError *error, gpointer user_data);
 static void update_random_pincode (MoblinPanel *self);
 static void create_selected_device (MoblinPanel *self);
+static void cancel_visible_updates (MoblinPanel *self);
 
 static void
 power_switch_toggled_cb (MxGtkLightSwitch *light_switch,
@@ -253,8 +254,9 @@ make_discoverable (MoblinPanel *panel)
 
 	bluetooth_client_set_discoverable (priv->client, TRUE, DISCOVER_TIMEOUT);
 
-	priv->visible_countdown = DISCOVER_TIMEOUT;
+	cancel_visible_updates (panel);
 
+	priv->visible_countdown = DISCOVER_TIMEOUT;
 	update_visible (panel);
 	priv->update_visible_source_id =
 		g_timeout_add_seconds (5, update_visible, panel);



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