[gnome-control-center] Revert "region: Create a source from the X layout in use when setting is empty"



commit 4abdc131c9725d116157c85f515cfab2f6b14b4a
Author: Rui Matos <tiagomatos gmail com>
Date:   Fri Sep 21 22:24:50 2012 +0200

    Revert "region: Create a source from the X layout in use when setting is empty"
    
    This reverts commit 1e0192555b686f24d084903d4ce70b5534af6260.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684584

 panels/region/gnome-region-panel-input.c  |   48 -----------------------------
 panels/region/gnome-region-panel-input.h  |    2 -
 panels/region/gnome-region-panel-system.c |    6 ---
 3 files changed, 0 insertions(+), 56 deletions(-)
---
diff --git a/panels/region/gnome-region-panel-input.c b/panels/region/gnome-region-panel-input.c
index f786f81..94d73d6 100644
--- a/panels/region/gnome-region-panel-input.c
+++ b/panels/region/gnome-region-panel-input.c
@@ -556,49 +556,6 @@ populate_model (GtkListStore *store,
   g_hash_table_destroy (active_sources_table);
 }
 
-GVariant *
-create_source_from_current_xkb_config (void)
-{
-  GVariantBuilder builder;
-  XkbRF_VarDefsRec *xkb_var_defs;
-  gchar *tmp;
-  gchar *source_id = NULL;
-  gchar **layouts = NULL;
-  gchar **variants = NULL;
-
-  g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(ss)"));
-
-  gnome_xkb_info_get_var_defs (&tmp, &xkb_var_defs);
-  g_free (tmp);
-
-  if (xkb_var_defs->layout)
-    layouts = g_strsplit (xkb_var_defs->layout, ",", 2);
-  if (xkb_var_defs->variant)
-    variants = g_strsplit (xkb_var_defs->variant, ",", 2);
-
-  if (layouts && layouts[0] && layouts[0][0])
-    source_id = g_strdup_printf ("%s", layouts[0]);
-  else
-    goto out;
-
-  if (variants && variants[0] && variants[0][0])
-    {
-      tmp = source_id;
-      source_id = g_strdup_printf ("%s+%s", tmp, variants[0]);
-      g_free (tmp);
-    }
-
-  g_variant_builder_add (&builder, "(ss)", INPUT_SOURCE_TYPE_XKB, source_id);
-
- out:
-  g_free (source_id);
-  g_strfreev (layouts);
-  g_strfreev (variants);
-  gnome_xkb_info_free_var_defs (xkb_var_defs);
-
-  return g_variant_builder_end (&builder);
-}
-
 static void
 populate_with_active_sources (GtkListStore *store)
 {
@@ -612,11 +569,6 @@ populate_with_active_sources (GtkListStore *store)
   GtkTreeIter tree_iter;
 
   sources = g_settings_get_value (input_sources_settings, KEY_INPUT_SOURCES);
-  if (g_variant_n_children (sources) < 1)
-    {
-      g_variant_unref (sources);
-      sources = create_source_from_current_xkb_config ();
-    }
 
   g_variant_iter_init (&iter, sources);
   while (g_variant_iter_next (&iter, "(&s&s)", &type, &id))
diff --git a/panels/region/gnome-region-panel-input.h b/panels/region/gnome-region-panel-input.h
index bf32899..47a1f52 100644
--- a/panels/region/gnome-region-panel-input.h
+++ b/panels/region/gnome-region-panel-input.h
@@ -31,8 +31,6 @@ G_BEGIN_DECLS
 void setup_input_tabs (GtkBuilder    *builder,
                        CcRegionPanel *self);
 
-GVariant * create_source_from_current_xkb_config (void);
-
 G_END_DECLS
 
 #endif  /* __GNOME_KEYBOARD_PROPERTY_INPUT_H */
diff --git a/panels/region/gnome-region-panel-system.c b/panels/region/gnome-region-panel-system.c
index 1092ea6..c031975 100644
--- a/panels/region/gnome-region-panel-system.c
+++ b/panels/region/gnome-region-panel-system.c
@@ -35,7 +35,6 @@
 #include "cc-common-language.h"
 #include "gdm-languages.h"
 #include "gnome-region-panel-system.h"
-#include "gnome-region-panel-input.h"
 
 #define WID(s) GTK_WIDGET(gtk_builder_get_object (dialog, s))
 
@@ -149,11 +148,6 @@ input_sources_changed (GSettings *settings,
         const gchar *id;
 
         sources = g_settings_get_value (input_sources_settings, "sources");
-        if (g_variant_n_children (sources) < 1) {
-                g_variant_unref (sources);
-                sources = create_source_from_current_xkb_config ();
-        }
-
         xkb_info = gnome_xkb_info_new ();
 
         label = WID ("user_input_source");



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