← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~cjcurran/indicator-sound/album-art-crasher into lp:indicator-sound

 

Conor Curran has proposed merging lp:~cjcurran/indicator-sound/album-art-crasher into lp:indicator-sound.

Requested reviews:
  Indicator Applet Developers (indicator-applet-developers)
Related bugs:
  #598438 indicator menu flickers when rhythmbox is playing some songs
  https://bugs.launchpad.net/bugs/598438


Fixes album art crasher bug and resets metadata on track update.

-- 
https://code.launchpad.net/~cjcurran/indicator-sound/album-art-crasher/+merge/28497
Your team ayatana-commits is subscribed to branch lp:indicator-sound.
=== modified file 'src/mpris-controller.vala'
--- src/mpris-controller.vala	2010-06-22 13:54:03 +0000
+++ src/mpris-controller.vala	2010-06-25 12:05:48 +0000
@@ -56,6 +56,7 @@
 	private void onTrackChange(dynamic DBus.Object mpris_client, HashTable<string,Value?> ht)
 	{
 		debug("onTrackChange");
+		this.controller.custom_items[this.controller.METADATA].reset(MetadataMenuitem.attributes_format());
 		this.controller.custom_items[this.controller.METADATA].update(ht,
 		                            MetadataMenuitem.attributes_format());
 	}

=== modified file 'src/player-item.vala'
--- src/player-item.vala	2010-06-24 16:23:39 +0000
+++ src/player-item.vala	2010-06-25 12:05:48 +0000
@@ -27,6 +27,13 @@
 	public PlayerItem()
 	{		
 	}
+
+	public void reset(HashSet<string> attrs){		
+		foreach(string s in attrs){
+			debug("attempting to set prop %s to null", s);
+			this.property_set(s, null);
+		}
+	}
 	
 	public void update(HashTable<string, Value?> data, HashSet<string> attributes)
 	{
@@ -39,7 +46,8 @@
 			string[] input_keys = property.split("-");
 			string search_key = input_keys[input_keys.length-1 : input_keys.length][0];
 			debug("search key = %s", search_key);
-			Value v = data.lookup(search_key);
+			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()));


Follow ups