diff options
author | Conor Curran <conor.curran@canonical.com> | 2010-06-17 16:41:54 +0100 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2010-06-17 16:41:54 +0100 |
commit | 05e82f2c6a8a72aeb3a589b702e5a9f1d68251d9 (patch) | |
tree | 1e0de7f106d14e59585926bed28db184f1434572 /src/metadata-menu-item.vala | |
parent | 4125fd9e2eb0de55d04482b3c035aa91fe7d547a (diff) | |
download | ayatana-indicator-sound-05e82f2c6a8a72aeb3a589b702e5a9f1d68251d9.tar.gz ayatana-indicator-sound-05e82f2c6a8a72aeb3a589b702e5a9f1d68251d9.tar.bz2 ayatana-indicator-sound-05e82f2c6a8a72aeb3a589b702e5a9f1d68251d9.zip |
transport plugged in
Diffstat (limited to 'src/metadata-menu-item.vala')
-rw-r--r-- | src/metadata-menu-item.vala | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/metadata-menu-item.vala b/src/metadata-menu-item.vala index 894ad3c..be078bd 100644 --- a/src/metadata-menu-item.vala +++ b/src/metadata-menu-item.vala @@ -17,12 +17,22 @@ public class MetadataMenuitem : Dbusmenu.Menuitem public void update(HashMap<string, string> data) { - this.property_set(DBUSMENU_METADATA_MENUITEM_TEXT_ARTIST, data.get("artist")); - this.property_set(DBUSMENU_METADATA_MENUITEM_TEXT_PIECE, data.get("title")); - this.property_set(DBUSMENU_METADATA_MENUITEM_TEXT_CONTAINER, data.get("album")); - this.property_set(DBUSMENU_METADATA_MENUITEM_IMAGE_PATH, data.get("arturl")); + this.property_set(DBUSMENU_METADATA_MENUITEM_TEXT_ARTIST, data.get("artist").strip()); + this.property_set(DBUSMENU_METADATA_MENUITEM_TEXT_PIECE, data.get("title").strip()); + this.property_set(DBUSMENU_METADATA_MENUITEM_TEXT_CONTAINER, data.get("album").strip()); + this.property_set(DBUSMENU_METADATA_MENUITEM_IMAGE_PATH, sanitize_image_path(data.get("arturl"))); } - + + public static string sanitize_image_path(string path) + { + string result = path.strip(); + if(result.contains("file:///")){ + result = result.slice(7, result.len()); + } + debug("Sanitize image path - result = %s", result); + return result; + } + public override void handle_event(string name, GLib.Value input_value, uint timestamp) { debug("MetadataItem -> handle event caught!"); |