aboutsummaryrefslogtreecommitdiff
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
parent18bd275be69c298102c78b0664854ec4ad88c433 (diff)
downloadayatana-indicator-keyboard-ebce729fcd5252901eb8ff345c1050473c0c288b.tar.gz
ayatana-indicator-keyboard-ebce729fcd5252901eb8ff345c1050473c0c288b.tar.bz2
ayatana-indicator-keyboard-ebce729fcd5252901eb8ff345c1050473c0c288b.zip
Minor fixes to migration.
-rw-r--r--debian/changelog6
-rw-r--r--lib/main.vala17
2 files changed, 20 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog
index 12262835..52f92bd2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+indicator-keyboard (0.0.0-0ubuntu13) saucy; urgency=low
+
+ * Migrate old keyboard layouts.
+
+ -- William Hua <william.hua@canonical.com> Thu, 20 Jun 2013 13:50:00 -0400
+
indicator-keyboard (0.0.0-0ubuntu12) saucy; urgency=low
* Remove indicator-keyboard-schema.
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 ());