aboutsummaryrefslogtreecommitdiff
path: root/src/player-item.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-06-22 12:43:24 +0100
committerConor Curran <conor.curran@canonical.com>2010-06-22 12:43:24 +0100
commit38e16eeeff6ec6f54662cc4da194e2ad1e024241 (patch)
treeda9a6ff8ec6e6c54d09e836ce261d22d13b59946 /src/player-item.vala
parent770b3266e2e7a92efb220f990d10ee0e36577b0f (diff)
downloadayatana-indicator-sound-38e16eeeff6ec6f54662cc4da194e2ad1e024241.tar.gz
ayatana-indicator-sound-38e16eeeff6ec6f54662cc4da194e2ad1e024241.tar.bz2
ayatana-indicator-sound-38e16eeeff6ec6f54662cc4da194e2ad1e024241.zip
silly vala errors rectified
Diffstat (limited to 'src/player-item.vala')
-rw-r--r--src/player-item.vala23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/player-item.vala b/src/player-item.vala
index 3cac208..09b0e6b 100644
--- a/src/player-item.vala
+++ b/src/player-item.vala
@@ -1,5 +1,4 @@
/*
-This service primarily controls PulseAudio and is driven by the sound indicator menu on the panel.
Copyright 2010 Canonical Ltd.
Authors:
@@ -36,20 +35,18 @@ public class PlayerItem : Dbusmenu.Menuitem
string[] input_keys = property.split("-");
string search_key = input_keys[input_keys.length-1 : input_keys.length][0];
debug("search key = %s", search_key);
- if (data.lookup(search_key).holds (typeof (string))){
- debug("track data change player item update");
- this.property_set(property, this.sanitize_string(data.lookup(search_key) as string));
+
+ Value v = data.lookup(search_key);
+
+ if (v.holds (typeof (string))){
+ this.property_set(property, this.sanitize_string(v.get_string()));
}
- else if (data.lookup(search_key).holds (typeof (int))){
- // Circumvent weird vala bug
- int* v = (int*)data.lookup(search_key);
- int r = *v;
- this.property_set_int(property, r);
+ else if (v.holds (typeof (int))){
+ debug("with value : %i", v.get_int());
+ this.property_set_int(property, v.get_int());
}
- else if(data.lookup(search_key).holds (typeof (bool))){
- bool* b = (bool*)data.lookup(search_key);
- bool input = *b;
- this.property_set_bool(property, input);
+ else if(v.holds (typeof (bool))){
+ this.property_set_bool(property, v.get_boolean());
}
}
}