[gnome-bluetooth] applet: Don't use the "show-icon" preference



commit 17f5f382d95d57274468d185b2df7cbbbe8ad54c
Author: Bastien Nocera <hadess hadess net>
Date:   Sun Feb 6 22:00:37 2011 +0000

    applet: Don't use the "show-icon" preference
    
    https://bugzilla.gnome.org/show_bug.cgi?id=641422

 applet/main.c |   30 +++---------------------------
 1 files changed, 3 insertions(+), 27 deletions(-)
---
diff --git a/applet/main.c b/applet/main.c
index b5a4ac6..a2b90f6 100644
--- a/applet/main.c
+++ b/applet/main.c
@@ -38,13 +38,8 @@
 
 static gboolean option_debug = FALSE;
 static BluetoothApplet *applet = NULL;
-static GSettings *settings = NULL;
-static gboolean show_icon_pref = TRUE;
 static gboolean discover_lock = FALSE;
 
-#define SCHEMA_NAME		"org.gnome.Bluetooth"
-#define PREF_SHOW_ICON		"show-icon"
-
 #define GNOMECC			"gnome-control-center"
 #define KEYBOARD_PREFS		GNOMECC " keyboard"
 #define MOUSE_PREFS		GNOMECC " mouse"
@@ -403,11 +398,9 @@ update_icon_visibility (void)
 	else
 		set_icon (TRUE);
 
-	if (show_icon_pref != FALSE) {
-		if (state != BLUETOOTH_KILLSWITCH_STATE_NO_ADAPTER) {
-			show_icon ();
-			return;
-		}
+	if (state != BLUETOOTH_KILLSWITCH_STATE_NO_ADAPTER) {
+		show_icon ();
+		return;
 	}
 	hide_icon ();
 }
@@ -860,15 +853,6 @@ done:
 				has_devices);
 }
 
-static void
-show_icon_changed (GSettings *settings,
-		   const char *key,
-		   gpointer   user_data)
-{
-	show_icon_pref = g_settings_get_boolean (settings, PREF_SHOW_ICON);
-	update_icon_visibility();
-}
-
 static GOptionEntry options[] = {
 	{ "debug", 'd', 0, G_OPTION_ARG_NONE, &option_debug, N_("Debug"), NULL },
 	{ NULL },
@@ -942,12 +926,6 @@ int main(int argc, char *argv[])
 	update_discoverability ((GObject*) applet, NULL, NULL);
 	update_device_list (applet, NULL);
 
-	settings = g_settings_new (SCHEMA_NAME);
-	show_icon_pref = g_settings_get_boolean (settings, PREF_SHOW_ICON);
-
-	g_signal_connect (G_OBJECT (settings), "changed::" PREF_SHOW_ICON,
-			  G_CALLBACK (show_icon_changed), NULL);
-
 	statusicon = init_notification();
 
 	update_icon_visibility();
@@ -963,8 +941,6 @@ int main(int argc, char *argv[])
 
 	gtk_widget_destroy(menu);
 
-	g_object_unref(settings);
-
 	cleanup_notification();
 
 	g_object_unref(applet);



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