aboutsummaryrefslogtreecommitdiff
path: root/src/player-item.vala
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2010-07-12 17:45:04 +0200
committerSebastien Bacher <seb128@ubuntu.com>2010-07-12 17:45:04 +0200
commitf6ffb190261dfdbbf55e90b63c1cd06f03037e35 (patch)
treef34ba1947d158c3c38de6556f4049c518dc58c43 /src/player-item.vala
parent964106d9c8c140d9c27a22aca8078dfdab57c5e9 (diff)
parentd8253fc0cfe667316e2e5f033bcbfba4c3044297 (diff)
downloadayatana-indicator-sound-f6ffb190261dfdbbf55e90b63c1cd06f03037e35.tar.gz
ayatana-indicator-sound-f6ffb190261dfdbbf55e90b63c1cd06f03037e35.tar.bz2
ayatana-indicator-sound-f6ffb190261dfdbbf55e90b63c1cd06f03037e35.zip
Import upstream version 0.3.6
Diffstat (limited to 'src/player-item.vala')
-rw-r--r--src/player-item.vala23
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;
- }
-
}