diff options
author | Sebastien Bacher <seb128@ubuntu.com> | 2010-09-08 12:32:06 +0200 |
---|---|---|
committer | Sebastien Bacher <seb128@ubuntu.com> | 2010-09-08 12:32:06 +0200 |
commit | e8dbd1c4501965be441fb99855dc5d2f52d549dd (patch) | |
tree | 351494f8a9e94c35280dbc584e8abf7c3f71eb8e /src/player-item.vala | |
parent | 0b25b8a95dfd8b8b6743f7a0a055be05dfea956b (diff) | |
parent | b347212eb1cb41fb9739a9873b0ff8eb8abb4b77 (diff) | |
download | ayatana-indicator-sound-e8dbd1c4501965be441fb99855dc5d2f52d549dd.tar.gz ayatana-indicator-sound-e8dbd1c4501965be441fb99855dc5d2f52d549dd.tar.bz2 ayatana-indicator-sound-e8dbd1c4501965be441fb99855dc5d2f52d549dd.zip |
* New upstream release fixing those issues
Diffstat (limited to 'src/player-item.vala')
-rw-r--r-- | src/player-item.vala | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/player-item.vala b/src/player-item.vala index fbfacbd..68ae6ef 100644 --- a/src/player-item.vala +++ b/src/player-item.vala @@ -25,7 +25,7 @@ public class PlayerItem : Dbusmenu.Menuitem public PlayerController owner {get; construct;} public string item_type { get; construct; } private const int EMPTY = -1; - + public PlayerItem(string type) { Object(item_type: type); @@ -42,6 +42,12 @@ public class PlayerItem : Dbusmenu.Menuitem } } + /** + * update() + * Base update method for playeritems, takes the attributes and the incoming updates + * and attmepts to update the appropriate props on the object. + * Album art is handled separately to deal with remote and local file paths. + */ public void update(HashTable<string, Value?> data, HashSet<string> attributes) { debug("PlayerItem::update()"); @@ -59,16 +65,14 @@ 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("mpris:artUrl")){ - try{ - update = Filename.from_uri(update.strip()); - } - catch(ConvertError e){ - warning("Problem converting URI %s to file path", update); - } + if(property.contains("mpris:artUrl")){ + // We know its a metadata instance because thats the only + // object with the arturl prop + MetadataMenuitem metadata = this as MetadataMenuitem; + metadata.fetch_art(update.strip(), property); + continue; } - this.property_set(property, update); + this.property_set(property, update); } else if (v.holds (typeof (int))){ debug("with value : %i", v.get_int()); @@ -83,7 +87,6 @@ public class PlayerItem : Dbusmenu.Menuitem this.property_set_bool(property, v.get_boolean()); } } - if(this.property_get_bool(MENUITEM_PROP_VISIBLE) == false){ this.property_set_bool(MENUITEM_PROP_VISIBLE, true); } @@ -101,5 +104,6 @@ public class PlayerItem : Dbusmenu.Menuitem } return false; } + } |