aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWilliam Hua <william.hua@canonical.com>2013-06-20 13:50:33 -0400
committerWilliam Hua <william.hua@canonical.com>2013-06-20 13:50:33 -0400
commitebce729fcd5252901eb8ff345c1050473c0c288b (patch)
treee4f53a5871735ac299312d344f3bd28eb262e6a4 /lib
parent18bd275be69c298102c78b0664854ec4ad88c433 (diff)
downloadayatana-indicator-keyboard-ebce729fcd5252901eb8ff345c1050473c0c288b.tar.gz
ayatana-indicator-keyboard-ebce729fcd5252901eb8ff345c1050473c0c288b.tar.bz2
ayatana-indicator-keyboard-ebce729fcd5252901eb8ff345c1050473c0c288b.zip
Minor fixes to migration.
Diffstat (limited to 'lib')
-rw-r--r--lib/main.vala17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/main.vala b/lib/main.vala
index e06c7794..b9560459 100644
--- a/lib/main.vala
+++ b/lib/main.vala
@@ -72,11 +72,19 @@ public class Indicator.Keyboard.Service : Object {
var engines = ibus.list_active_engines ();
foreach (var engine in engines) {
- if (length == 0) {
+ if (length == 0 || engine.name.has_prefix ("xkb")) {
var source = "us";
var layout = engine.get_layout ();
var variant = engine.get_layout_variant ();
+ if (layout != null && layout.length == 0) {
+ layout = null;
+ }
+
+ if (variant != null && variant.length == 0) {
+ variant = null;
+ }
+
if (layout != null && variant != null) {
source = @"$layout+$variant";
} else if (layout != null) {
@@ -84,10 +92,13 @@ public class Indicator.Keyboard.Service : Object {
}
builder.add ("(ss)", "xkb", source);
+ length++;
}
- builder.add ("(ss)", "ibus", engine.name);
- length++;
+ if (!engine.name.has_prefix ("xkb")) {
+ builder.add ("(ss)", "ibus", engine.name);
+ length++;
+ }
}
this.source_settings.set_value ("sources", builder.end ());