aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWilliam Hua <william.hua@canonical.com>2014-09-12 12:19:06 -0400
committerWilliam Hua <william.hua@canonical.com>2014-09-12 12:19:06 -0400
commit449e1ab74019f4d1e9d60f3b97a31309a6f793fa (patch)
treebb04f341af6e22b99a512615d47828e49429706b /lib
parent79042408b9bd304c61578a8c94e3a131a74444b7 (diff)
downloadayatana-indicator-keyboard-449e1ab74019f4d1e9d60f3b97a31309a6f793fa.tar.gz
ayatana-indicator-keyboard-449e1ab74019f4d1e9d60f3b97a31309a6f793fa.tar.bz2
ayatana-indicator-keyboard-449e1ab74019f4d1e9d60f3b97a31309a6f793fa.zip
Use iterator () method.
Diffstat (limited to 'lib')
-rw-r--r--lib/main.vala11
-rw-r--r--lib/source.vala5
2 files changed, 5 insertions, 11 deletions
diff --git a/lib/main.vala b/lib/main.vala
index b8f34599..c5d4b6da 100644
--- a/lib/main.vala
+++ b/lib/main.vala
@@ -266,11 +266,9 @@ public class Indicator.Keyboard.Service : Object {
Act.User? user = manager.get_user ((!) greeter_user);
if (user != null && ((!) user).is_loaded) {
- VariantIter outer;
- VariantIter inner;
+ var outer = ((!) user).input_sources.iterator ();
- var sources = ((!) user).input_sources;
- sources.get ("aa{ss}", out outer);
+ VariantIter inner;
while (outer.next ("a{ss}", out inner)) {
unowned string key;
@@ -460,14 +458,11 @@ public class Indicator.Keyboard.Service : Object {
foreach (var user in users) {
if (user.is_loaded) {
+ var outer = user.input_sources.iterator ();
var done = false;
- VariantIter outer;
VariantIter inner;
- var sources = user.input_sources;
- sources.get ("aa{ss}", out outer);
-
while (outer.next ("a{ss}", out inner)) {
unowned string key;
unowned string source;
diff --git a/lib/source.vala b/lib/source.vala
index 2777f521..7850f211 100644
--- a/lib/source.vala
+++ b/lib/source.vala
@@ -100,12 +100,11 @@ public class Indicator.Keyboard.Source : Object {
fcitx = name;
}
} else if (variant.is_of_type (new VariantType ("a{ss}"))) {
- VariantIter iter;
+ var iter = variant.iterator ();
+
unowned string key;
unowned string value;
- variant.get ("a{ss}", out iter);
-
while (iter.next ("{&s&s}", out key, out value)) {
if (key == "xkb") {
xkb = value;