[gnome-settings-daemon] main: fix build



commit 31a1a8b679d8cc93661170e4d6b13d280bc29856
Author: William Jon McCann <jmccann redhat com>
Date:   Fri Feb 15 13:49:01 2013 -0500

    main: fix build

 gnome-settings-daemon/main.c |   80 +++++++++++++++++++++--------------------
 1 files changed, 41 insertions(+), 39 deletions(-)
---
diff --git a/gnome-settings-daemon/main.c b/gnome-settings-daemon/main.c
index 14bb437..24c1598 100644
--- a/gnome-settings-daemon/main.c
+++ b/gnome-settings-daemon/main.c
@@ -242,6 +242,43 @@ set_locale (GDBusProxy *proxy)
         g_object_unref (locale_settings);
 }
 
+#ifdef HAVE_IBUS
+static gboolean
+is_program_in_path (const char *binary)
+{
+       char *path;
+
+       path = g_find_program_in_path (binary);
+       if (path == NULL)
+               return FALSE;
+       g_free (path);
+       return TRUE;
+}
+
+static gboolean
+keyboard_plugin_is_enabled (void)
+{
+        GSettings *settings;
+        gboolean enabled;
+
+        settings = g_settings_new ("org.gnome.settings-daemon.plugins.keyboard");
+        enabled = g_settings_get_boolean (settings, "active");
+        g_object_unref (settings);
+
+        return enabled;
+}
+
+static void
+set_legacy_ibus_env_vars (GDBusProxy *proxy)
+{
+        if (is_program_in_path ("ibus-daemon") &&
+            keyboard_plugin_is_enabled ()) {
+                set_session_env (proxy, "QT_IM_MODULE", "ibus");
+                set_session_env (proxy, "XMODIFIERS", "@im=ibus");
+        }
+}
+#endif
+
 /* Keep synchronised with set_locale() and
  * set_legacy_ibus_env_vars() above */
 static void
@@ -263,12 +300,14 @@ set_locale_env (void)
         g_free (region);
         g_object_unref (locale_settings);
 
+#ifdef HAVE_IBUS
         /* Set IBus legacy environment */
         if (is_program_in_path ("ibus-daemon") &&
             keyboard_plugin_is_enabled ()) {
-                g_setenv ("QT_IM_MODULE", "ibus");
-                g_setenv ("XMODIFIERS", "@im=ibus");
+                g_setenv ("QT_IM_MODULE", "ibus", TRUE);
+                g_setenv ("XMODIFIERS", "@im=ibus", TRUE);
         }
+#endif
 }
 
 static void
@@ -289,43 +328,6 @@ register_with_gnome_session (GDBusProxy *proxy)
                            manager);
 }
 
-#ifdef HAVE_IBUS
-static gboolean
-is_program_in_path (const char *binary)
-{
-       char *path;
-
-       path = g_find_program_in_path (binary);
-       if (path == NULL)
-               return FALSE;
-       g_free (path);
-       return TRUE;
-}
-
-static gboolean
-keyboard_plugin_is_enabled (void)
-{
-        GSettings *settings;
-        gboolean enabled;
-
-        settings = g_settings_new ("org.gnome.settings-daemon.plugins.keyboard");
-        enabled = g_settings_get_boolean (settings, "active");
-        g_object_unref (settings);
-
-        return enabled;
-}
-
-static void
-set_legacy_ibus_env_vars (GDBusProxy *proxy)
-{
-        if (is_program_in_path ("ibus-daemon") &&
-            keyboard_plugin_is_enabled ()) {
-                set_session_env (proxy, "QT_IM_MODULE", "ibus");
-                set_session_env (proxy, "XMODIFIERS", "@im=ibus");
-        }
-}
-#endif
-
 static gboolean
 on_term_signal_pipe_closed (GIOChannel *source,
                             GIOCondition condition,


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