diff options
author | Conor Curran <conor.curran@canonical.com> | 2010-07-12 15:34:10 +0100 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2010-07-12 15:34:10 +0100 |
commit | 8f4dd989349434361a383f54917b08efd9af2d46 (patch) | |
tree | 7fae59d6256f8b6713db9b477c92f18dd0f73532 /src/player-item.vala | |
parent | b0a09afe59a904ce4b4e90e58d933ad1f0b036d9 (diff) | |
parent | c653012e7a55de1a6ecabf798a7d86e87d4affc6 (diff) | |
download | ayatana-indicator-sound-8f4dd989349434361a383f54917b08efd9af2d46.tar.gz ayatana-indicator-sound-8f4dd989349434361a383f54917b08efd9af2d46.tar.bz2 ayatana-indicator-sound-8f4dd989349434361a383f54917b08efd9af2d46.zip |
merge with the static scope problems widget side, plus positioning fixes and image url handling robustness
Diffstat (limited to 'src/player-item.vala')
-rw-r--r-- | src/player-item.vala | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/player-item.vala b/src/player-item.vala index 171c140..3e10b7b 100644 --- a/src/player-item.vala +++ b/src/player-item.vala @@ -55,8 +55,17 @@ public class PlayerItem : Dbusmenu.Menuitem Value? v = data.lookup(search_key); if (v.holds (typeof (string))){ - debug("with value : %s", v.get_string()); - this.property_set(property, this.sanitize_string(v.get_string())); + string update = v.get_string().strip(); + debug("with value : %s", update); + if(property.contains("arturl")){ + try{ + update = Filename.from_uri(update.strip()); + } + catch(ConvertError e){ + warning("Problem converting URI %s to file path", update); + } + } + this.property_set(property, update); } else if (v.holds (typeof (int))){ debug("with value : %i", v.get_int()); @@ -80,15 +89,5 @@ public class PlayerItem : Dbusmenu.Menuitem return true; } - public static string sanitize_string(string st) - { - string result = st.strip(); - if(result.has_prefix("file:///")){ - result = result.slice(7, result.len()); - } - debug("Sanitize string - result = %s", result); - return result; - } - } |