[gnome-bluetooth] Fix callback arguments for NbtkGtkLightSwitch



commit 2f74e2c60abe4b1363b9446a52cc2dfeba7a76e7
Author: Joshua Lock <josh linux intel com>
Date:   Wed Oct 14 18:31:51 2009 +0100

    Fix callback arguments for NbtkGtkLightSwitch
    
    The callback signature has an extra parameter, this was causing an attempt
    at casting a gboolean to a MoblinPanel and causing a crash.
    This patch also fixes up the callback method to use the passed parameters.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=598472

 moblin/moblin-panel.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/moblin/moblin-panel.c b/moblin/moblin-panel.c
index 6750c2c..a1e049d 100644
--- a/moblin/moblin-panel.c
+++ b/moblin/moblin-panel.c
@@ -139,12 +139,12 @@ static void create_selected_device (MoblinPanel *self);
 
 static void
 power_switch_toggled_cb (NbtkGtkLightSwitch *light_switch,
+			 gboolean 	     state,
                          gpointer            user_data)
 {
-	g_assert (MOBLIN_IS_PANEL (user_data));
 	MoblinPanelPrivate *priv = MOBLIN_PANEL_GET_PRIVATE(user_data);
 
-	if (nbtk_gtk_light_switch_get_active (NBTK_GTK_LIGHT_SWITCH (priv->power_switch))) {
+	if (state == TRUE) {
 		bluetooth_killswitch_set_state (priv->killswitch, KILLSWITCH_STATE_UNBLOCKED);
 	} else {
 		bluetooth_killswitch_set_state (priv->killswitch, KILLSWITCH_STATE_SOFT_BLOCKED);



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