← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~cjcurran/indicator-sound/default-player-in-menu into lp:indicator-sound

 

Conor Curran has proposed merging lp:~cjcurran/indicator-sound/default-player-in-menu into lp:indicator-sound.

Requested reviews:
  Indicator Applet Developers (indicator-applet-developers)
Related bugs:
  #664743 Default music player should be present in the menu from a clean install
  https://bugs.launchpad.net/bugs/664743


Fixes attached bug


-- 
https://code.launchpad.net/~cjcurran/indicator-sound/default-player-in-menu/+merge/40082
Your team ayatana-commits is subscribed to branch lp:indicator-sound.
=== modified file 'src/familiar-players-db.vala'
--- src/familiar-players-db.vala	2010-09-07 14:12:08 +0000
+++ src/familiar-players-db.vala	2010-11-04 13:06:07 +0000
@@ -29,6 +29,7 @@
 {
 	private const string GROUP_NAME = "Seen Database";
 	private const string KEY_NAME = "DesktopFiles";	
+  private const string DEFAULT_APP_DESKTOP = "/usr/share/applications/rhythmbox.desktop";
 	private HashMap<string, bool> players_DB;
 	private string file_name;
 	private string dir_name;
@@ -38,13 +39,18 @@
 	public FamiliarPlayersDB()
 	{
 		this.write_id = 0;
-		this.players_DB = new HashMap<string, bool>();		
+		this.players_DB = new HashMap<string, bool>();	
+    if ( !create_key_file() ){
+      this.players_DB.set(DEFAULT_APP_DESKTOP, true);
+      this.write_db();
+    }
+    
 		this.dir_name = build_filename(get_user_cache_dir(), "indicators", "sound");
 		this.file_name = build_filename(this.dir_name, "familiar-players-db.keyfile");
 		if(create_key_file() && check_for_keys() && load_data_from_key_file()){
 			debug("keyfiles in place and ready for action");			
 		}
-		else{
+		else{      
 			this.key_file = null;
 			warning("FamiliarPlayersDB:: problems loading key file - can't go any further");
 		}		


Follow ups