~attente/unity-settings-daemon/1226962

« back to all changes in this revision

Viewing changes to plugins/keyboard/gsd-keyboard-manager.c

  • Committer: CI Train Bot
  • Author(s): Mitsuya Shibata
  • Date: 2015-11-06 14:40:38 UTC
  • mfrom: (4111.3.1 unity-settings-daemon)
  • Revision ID: ci-train-bot@canonical.com-20151106144038-rd1it51guay79cci
unity-settings-daemon should initialize org.gnome.desktop.input-sources
for fcitx as same as ibus when sources property is empty.

additionally to this, change the default japanese im engine from anthy to mozc. Fixes: #1465535
Approved by: Sebastien Bacher

Show diffs side-by-side

added added

removed removed

Lines of Context:
510
510
                { "bn_IN", "m17n:bn:inscript" },
511
511
                { "gu_IN", "m17n:gu:inscript" },
512
512
                { "hi_IN", "m17n:hi:inscript" },
513
 
                { "ja_JP", "anthy" },
 
513
                { "ja_JP", "mozc" },
514
514
                { "kn_IN", "m17n:kn:kgp" },
515
515
                { "ko_KR", "hangul" },
516
516
                { "mai_IN", "m17n:mai:inscript" },
539
539
}
540
540
 
541
541
static void
542
 
add_ibus_sources_from_locale (GSettings *settings)
 
542
add_sources_from_locale (GsdKeyboardManager *manager, GSettings *settings)
543
543
{
544
544
        const gchar *locale_engine;
545
545
        GVariantBuilder builder;
549
549
                return;
550
550
 
551
551
        init_builder_with_sources (&builder, settings);
552
 
        g_variant_builder_add (&builder, "(ss)", INPUT_SOURCE_TYPE_IBUS, locale_engine);
 
552
#ifdef HAVE_IBUS
 
553
        if (manager->priv->is_ibus_active) {
 
554
                g_variant_builder_add (&builder, "(ss)", INPUT_SOURCE_TYPE_IBUS, locale_engine);
 
555
        }
 
556
#endif
 
557
#ifdef HAVE_FCITX
 
558
        if (manager->priv->is_fcitx_active) {
 
559
                g_variant_builder_add (&builder, "(ss)", INPUT_SOURCE_TYPE_FCITX, locale_engine);
 
560
        }
 
561
#endif
553
562
        g_settings_set_value (settings, KEY_INPUT_SOURCES, g_variant_builder_end (&builder));
554
563
}
555
564
 
2134
2143
        sources = g_settings_get_value (settings, KEY_INPUT_SOURCES);
2135
2144
        if (g_variant_n_children (sources) < 1) {
2136
2145
                get_sources_from_xkb_config (manager);
2137
 
#ifdef HAVE_IBUS
2138
 
                add_ibus_sources_from_locale (settings);
 
2146
#if defined(HAVE_IBUS) || defined(HAVE_FCITX)
 
2147
                add_sources_from_locale (manager, settings);
2139
2148
#endif
2140
2149
        }
2141
2150
        g_variant_unref (sources);