[gnome-settings-daemon/f19] Add a patch to stop adding input sources automatically based on locale

rtcm rtcm at fedoraproject.org
Fri May 17 16:09:08 UTC 2013


commit 4d43eca73435d48ddf8b0d261ca09652766f6a42
Author: Rui Matos <tiagomatos at gmail.com>
Date:   Fri May 17 17:56:18 2013 +0200

    Add a patch to stop adding input sources automatically based on locale

 ...op-adding-locale-based-input-sources-from.patch |   94 ++++++++++++++++++++
 gnome-settings-daemon-ibus-kkc-libpinyin.patch     |   20 ----
 gnome-settings-daemon.spec                         |   10 ++-
 3 files changed, 101 insertions(+), 23 deletions(-)
---
diff --git a/0001-keyboard-Stop-adding-locale-based-input-sources-from.patch b/0001-keyboard-Stop-adding-locale-based-input-sources-from.patch
new file mode 100644
index 0000000..8dd93fc
--- /dev/null
+++ b/0001-keyboard-Stop-adding-locale-based-input-sources-from.patch
@@ -0,0 +1,94 @@
+From 49d2e09887fc4bd1d12f11f5b49ec5f7e091d05c Mon Sep 17 00:00:00 2001
+From: Rui Matos <tiagomatos at gmail.com>
+Date: Mon, 4 Mar 2013 17:32:57 +0100
+Subject: [PATCH] keyboard: Stop adding locale based input sources from a
+ hardcoded list
+
+This was never meant to be the definite way to do it and we now have
+gnome-initial-setup which is a better place to do this.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=685567
+---
+ plugins/keyboard/gsd-keyboard-manager.c | 58 +--------------------------------
+ 1 file changed, 1 insertion(+), 57 deletions(-)
+
+diff --git a/plugins/keyboard/gsd-keyboard-manager.c b/plugins/keyboard/gsd-keyboard-manager.c
+index ebfa7d8..b15d355 100644
+--- a/plugins/keyboard/gsd-keyboard-manager.c
++++ b/plugins/keyboard/gsd-keyboard-manager.c
+@@ -468,58 +468,6 @@ out:
+         return (gchar **) g_ptr_array_free (opt_array, FALSE);
+ }
+ 
+-static const gchar *
+-engine_from_locale (void)
+-{
+-        const gchar *locale;
+-        const gchar *locale_engine[][2] = {
+-                { "as_IN", "m17n:as:phonetic" },
+-                { "bn_IN", "m17n:bn:inscript" },
+-                { "gu_IN", "m17n:gu:inscript" },
+-                { "hi_IN", "m17n:hi:inscript" },
+-                { "ja_JP", "anthy" },
+-                { "kn_IN", "m17n:kn:kgp" },
+-                { "ko_KR", "hangul" },
+-                { "mai_IN", "m17n:mai:inscript" },
+-                { "ml_IN", "m17n:ml:inscript" },
+-                { "mr_IN", "m17n:mr:inscript" },
+-                { "or_IN", "m17n:or:inscript" },
+-                { "pa_IN", "m17n:pa:inscript" },
+-                { "sd_IN", "m17n:sd:inscript" },
+-                { "ta_IN", "m17n:ta:tamil99" },
+-                { "te_IN", "m17n:te:inscript" },
+-                { "zh_CN", "pinyin" },
+-                { "zh_HK", "cangjie3" },
+-                { "zh_TW", "chewing" },
+-        };
+-        gint i;
+-
+-        locale = setlocale (LC_CTYPE, NULL);
+-        if (!locale)
+-                return NULL;
+-
+-        for (i = 0; i < G_N_ELEMENTS (locale_engine); ++i)
+-                if (g_str_has_prefix (locale, locale_engine[i][0]))
+-                        return locale_engine[i][1];
+-
+-        return NULL;
+-}
+-
+-static void
+-add_ibus_sources_from_locale (GSettings *settings)
+-{
+-        const gchar *locale_engine;
+-        GVariantBuilder builder;
+-
+-        locale_engine = engine_from_locale ();
+-        if (!locale_engine)
+-                return;
+-
+-        init_builder_with_sources (&builder, settings);
+-        g_variant_builder_add (&builder, "(ss)", INPUT_SOURCE_TYPE_IBUS, locale_engine);
+-        g_settings_set_value (settings, KEY_INPUT_SOURCES, g_variant_builder_end (&builder));
+-}
+-
+ static void
+ convert_ibus (GSettings *settings)
+ {
+@@ -1465,12 +1413,8 @@ maybe_create_initial_settings (GsdKeyboardManager *manager)
+ 
+         /* if we still don't have anything do some educated guesses */
+         sources = g_settings_get_value (settings, KEY_INPUT_SOURCES);
+-        if (g_variant_n_children (sources) < 1) {
++        if (g_variant_n_children (sources) < 1)
+                 get_sources_from_xkb_config (manager);
+-#ifdef HAVE_IBUS
+-                add_ibus_sources_from_locale (settings);
+-#endif
+-        }
+         g_variant_unref (sources);
+ 
+         options = g_settings_get_strv (settings, KEY_KEYBOARD_OPTIONS);
+-- 
+1.8.1.4
+
diff --git a/gnome-settings-daemon.spec b/gnome-settings-daemon.spec
index 6d8b08f..d02a087 100644
--- a/gnome-settings-daemon.spec
+++ b/gnome-settings-daemon.spec
@@ -10,8 +10,8 @@ URL:            http://download.gnome.org/sources/%{name}
 Source:         http://download.gnome.org/sources/%{name}/3.8/%{name}-%{version}.tar.xz
 # disable wacom for ppc/ppc64 (used on RHEL)
 Patch0:         %{name}-3.5.4-ppc-no-wacom.patch
-# fedora has newer different default ibus engines for Chinese and Japanese
-Patch1:         %{name}-ibus-kkc-libpinyin.patch
+# g-i-s takes this role now
+Patch1:         0001-keyboard-Stop-adding-locale-based-input-sources-from.patch
 
 Requires: control-center-filesystem
 Requires: colord
@@ -79,7 +79,7 @@ The %{name}-updates package contains the updates plugin for %{name}
 %if 0%{?rhel}
 %patch0 -p1 -b .ppc-no-wacom
 %endif
-%patch1 -p1 -b .ibus-anthy-pinyin
+%patch1 -p1
 
 autoreconf -i -f
 
@@ -256,6 +256,10 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
 %{_datadir}/glib-2.0/schemas/org.gnome.settings-daemon.plugins.updates.gschema.xml
 
 %changelog
+* Fri May 17 2013 Rui Matos <rmatos at redhat.com>
+- Add a patch to stop adding input sources automatically based on
+  locale since that's now gnome-initial-setup's job
+
 * Tue May 14 2013 Richard Hughes <rhughes at redhat.com> - 3.8.2-1
 - Update to 3.8.2
 


More information about the scm-commits mailing list