diff options
author | Sebastien Bacher <seb128@ubuntu.com> | 2010-07-22 21:04:26 +0200 |
---|---|---|
committer | Sebastien Bacher <seb128@ubuntu.com> | 2010-07-22 21:04:26 +0200 |
commit | 1777ee4291dc792ca3d4df087c8af23cd8458961 (patch) | |
tree | 101cc9ea1b424973a7c43cd7ce7bb9c4f9ac66aa /src/player-item.vala | |
parent | f6ffb190261dfdbbf55e90b63c1cd06f03037e35 (diff) | |
parent | c7316aef6047ef29ab71fbcd34d6932fb0e521ad (diff) | |
download | ayatana-indicator-sound-1777ee4291dc792ca3d4df087c8af23cd8458961.tar.gz ayatana-indicator-sound-1777ee4291dc792ca3d4df087c8af23cd8458961.tar.bz2 ayatana-indicator-sound-1777ee4291dc792ca3d4df087c8af23cd8458961.zip |
Import upstream version 0.3.8
Diffstat (limited to 'src/player-item.vala')
-rw-r--r-- | src/player-item.vala | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/player-item.vala b/src/player-item.vala index 3e10b7b..2952f71 100644 --- a/src/player-item.vala +++ b/src/player-item.vala @@ -38,6 +38,7 @@ public class PlayerItem : Dbusmenu.Menuitem foreach(string s in attrs){ debug("attempting to set prop %s to null", s); this.property_set(s, null); + this.property_set_int(s, 0); } } @@ -47,7 +48,8 @@ public class PlayerItem : Dbusmenu.Menuitem if(ensure_valid_updates(data, attributes) == false){ debug("PlayerItem::Update -> The hashtable update does not contain what we were expecting - just leave it!"); return; - } + } + foreach(string property in attributes){ string[] input_keys = property.split("-"); string search_key = input_keys[input_keys.length-1 : input_keys.length][0]; @@ -57,6 +59,7 @@ public class PlayerItem : Dbusmenu.Menuitem if (v.holds (typeof (string))){ string update = v.get_string().strip(); debug("with value : %s", update); + // Special case for the arturl URI's. if(property.contains("arturl")){ try{ update = Filename.from_uri(update.strip()); @@ -71,6 +74,10 @@ public class PlayerItem : Dbusmenu.Menuitem debug("with value : %i", v.get_int()); this.property_set_int(property, v.get_int()); } + else if (v.holds (typeof (uint))){ + debug("with value : %i", (int)v.get_uint()); + this.property_set_int(property, (int)v.get_uint()); + } else if(v.holds (typeof (bool))){ this.property_set_bool(property, v.get_boolean()); } @@ -82,10 +89,10 @@ public class PlayerItem : Dbusmenu.Menuitem if(data == null){ return false; } - if(data.size() < attributes.size){ + /*if(data.size() < attributes.size){ warning("update hash was too small for the target"); return false; - } + }*/ return true; } |