[gnome-initial-setup] cc-input-chooser: Fix build without IBus



commit a9d1972844530aabfbf33c8949c289c243a4023b
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Aug 27 10:55:07 2014 -0400

    cc-input-chooser: Fix build without IBus

 .../pages/keyboard/cc-input-chooser.c              |   26 +++++++++----------
 1 files changed, 12 insertions(+), 14 deletions(-)
---
diff --git a/gnome-initial-setup/pages/keyboard/cc-input-chooser.c 
b/gnome-initial-setup/pages/keyboard/cc-input-chooser.c
index 2a6eb5d..3a059fd 100644
--- a/gnome-initial-setup/pages/keyboard/cc-input-chooser.c
+++ b/gnome-initial-setup/pages/keyboard/cc-input-chooser.c
@@ -136,31 +136,29 @@ get_layout (CcInputChooser *chooser,
 {
         CcInputChooserPrivate *priv = cc_input_chooser_get_instance_private (chooser);
 
-       *layout = "";
-       *variant = "";
-
        if (g_str_equal (type, INPUT_SOURCE_TYPE_XKB)) {
                gnome_xkb_info_get_layout_info (priv->xkb_info,
                                                id, NULL, NULL,
                                                layout, variant);
+                return TRUE;
+        }
 #ifdef HAVE_IBUS
-       } else if (g_str_equal (type, INPUT_SOURCE_TYPE_IBUS)) {
+       if (g_str_equal (type, INPUT_SOURCE_TYPE_IBUS)) {
                 IBusEngineDesc *engine_desc = NULL;
 
                if (priv->ibus_engines)
                        engine_desc = g_hash_table_lookup (priv->ibus_engines, id);
-               else
-                       return FALSE;
 
-               if (engine_desc) {
-                       *layout = ibus_engine_desc_get_layout (engine_desc);
-                       *variant = "";
-               } else {
-                       return FALSE;
-               }
+               if (!engine_desc)
+                        return FALSE;
+
+                *layout = ibus_engine_desc_get_layout (engine_desc);
+                *variant = "";
+                return TRUE;
        }
 #endif
-       return TRUE;
+        g_assert_not_reached ();
+       return FALSE;
 }
 
 static gboolean


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