aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hua <william.hua@canonical.com>2013-09-21 11:01:35 -0400
committerWilliam Hua <william.hua@canonical.com>2013-09-21 11:01:35 -0400
commitcaa8187d0c9dd3e891b9a0ba4967fdeb901f76e9 (patch)
tree3e5935654c40bad7c0eccfc035286a26fee4c482
parent04f6c6c8a443bd58d95be15b6860f3b0e98e18a7 (diff)
downloadayatana-indicator-keyboard-caa8187d0c9dd3e891b9a0ba4967fdeb901f76e9.tar.gz
ayatana-indicator-keyboard-caa8187d0c9dd3e891b9a0ba4967fdeb901f76e9.tar.bz2
ayatana-indicator-keyboard-caa8187d0c9dd3e891b9a0ba4967fdeb901f76e9.zip
Always add the default layout.
-rw-r--r--lib/main.vala15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/main.vala b/lib/main.vala
index 026be597..11802d8a 100644
--- a/lib/main.vala
+++ b/lib/main.vala
@@ -281,20 +281,21 @@ public class Indicator.Keyboard.Service : Object {
}
}
- if (list.size == 0) {
- var layout = LightDM.get_layout ();
+ var layout = LightDM.get_layout ();
- var source = layout.name;
- source = source.replace (" ", "+");
- source = source.replace ("\t", "+");
+ var source = layout.name;
+ source = source.replace (" ", "+");
+ source = source.replace ("\t", "+");
+ if (!added.contains (source)) {
list.add (source);
+ added.add (source);
}
var builder = new VariantBuilder (new VariantType ("a(ss)"));
- foreach (var layout in list) {
- builder.add ("(ss)", "xkb", layout);
+ foreach (var name in list) {
+ builder.add ("(ss)", "xkb", name);
}
source_settings.set_value ("sources", builder.end ());