[gnome-settings-daemon] keyboard: Remove "inited_ok" variable



commit 3145995cef3efc15f27763850981506a98faccbf
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Apr 26 17:55:20 2012 +0100

    keyboard: Remove "inited_ok" variable

 plugins/keyboard/gsd-keyboard-manager.c |    2 ++
 plugins/keyboard/gsd-keyboard-xkb.c     |   18 +++++-------------
 2 files changed, 7 insertions(+), 13 deletions(-)
---
diff --git a/plugins/keyboard/gsd-keyboard-manager.c b/plugins/keyboard/gsd-keyboard-manager.c
index 2542b1b..30a74d8 100644
--- a/plugins/keyboard/gsd-keyboard-manager.c
+++ b/plugins/keyboard/gsd-keyboard-manager.c
@@ -62,6 +62,8 @@
 #define KEY_BELL_DURATION  "bell-duration"
 #define KEY_BELL_MODE      "bell-mode"
 
+
+
 struct GsdKeyboardManagerPrivate
 {
 	guint      start_idle_id;
diff --git a/plugins/keyboard/gsd-keyboard-xkb.c b/plugins/keyboard/gsd-keyboard-xkb.c
index ce08ec6..f8e7118 100644
--- a/plugins/keyboard/gsd-keyboard-xkb.c
+++ b/plugins/keyboard/gsd-keyboard-xkb.c
@@ -42,7 +42,7 @@
 
 static GsdKeyboardManager *manager = NULL;
 
-static XklEngine *xkl_engine;
+static XklEngine *xkl_engine = NULL;
 static XklConfigRegistry *xkl_registry = NULL;
 
 static GkbdDesktopConfig current_config;
@@ -51,8 +51,6 @@ static GkbdKeyboardConfig current_kbd_config;
 /* never terminated */
 static GkbdKeyboardConfig initial_sys_kbd_config;
 
-static gboolean inited_ok = FALSE;
-
 static GSettings *settings_desktop = NULL;
 static GSettings *settings_keyboard = NULL;
 
@@ -115,7 +113,7 @@ ensure_xkl_registry (void)
 static void
 apply_desktop_settings (void)
 {
-	if (!inited_ok)
+	if (xkl_engine == NULL)
 		return;
 
 	gsd_keyboard_manager_apply_settings (manager);
@@ -379,7 +377,7 @@ apply_xkb_settings (void)
 {
 	GkbdKeyboardConfig current_sys_kbd_config;
 
-	if (!inited_ok)
+	if (xkl_engine == NULL)
 		return;
 
 	gkbd_keyboard_config_init (&current_sys_kbd_config, xkl_engine);
@@ -414,7 +412,7 @@ apply_xkb_settings (void)
 static void
 gsd_keyboard_xkb_analyze_sysconfig (void)
 {
-	if (!inited_ok)
+	if (xkl_engine == NULL)
 		return;
 
 	gkbd_keyboard_config_init (&initial_sys_kbd_config, xkl_engine);
@@ -447,8 +445,6 @@ gsd_keyboard_xkb_init (GsdKeyboardManager * kbd_manager)
 	if (!xkl_engine)
 		return;
 
-	inited_ok = TRUE;
-
 	gkbd_desktop_config_init (&current_config, xkl_engine);
 	gkbd_keyboard_config_init (&current_kbd_config,
 				   xkl_engine);
@@ -493,7 +489,7 @@ gsd_keyboard_xkb_init (GsdKeyboardManager * kbd_manager)
 void
 gsd_keyboard_xkb_shutdown (void)
 {
-	if (!inited_ok)
+	if (xkl_engine == NULL)
 		return;
 
 	manager = NULL;
@@ -501,9 +497,6 @@ gsd_keyboard_xkb_shutdown (void)
 	if (preview_dialogs != NULL)
 		g_hash_table_destroy (preview_dialogs);
 
-	if (!inited_ok)
-		return;
-
 	xkl_engine_stop_listen (xkl_engine,
 				XKLL_MANAGE_LAYOUTS |
 				XKLL_MANAGE_WINDOW_STATES);
@@ -523,5 +516,4 @@ gsd_keyboard_xkb_shutdown (void)
 	g_object_unref (xkl_engine);
 
 	xkl_engine = NULL;
-	inited_ok = FALSE;
 }



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