aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-09-07 21:28:16 +0100
committerConor Curran <conor.curran@canonical.com>2010-09-07 21:28:16 +0100
commit545c3307dd86fddf3c8a456eb01c224744f09b8e (patch)
tree70f23bc8c1642dd53167f3fe656236399f56bc09
parentcee98ff81f3511badf4ac804840b7879e02897f6 (diff)
parent5abb5a08c0d6282c5ef3569c8a561db15f88473f (diff)
downloadayatana-indicator-sound-545c3307dd86fddf3c8a456eb01c224744f09b8e.tar.gz
ayatana-indicator-sound-545c3307dd86fddf3c8a456eb01c224744f09b8e.tar.bz2
ayatana-indicator-sound-545c3307dd86fddf3c8a456eb01c224744f09b8e.zip
multiple offlined players allowed now in the menu
-rw-r--r--src/familiar-players-db.vala2
-rw-r--r--src/music-player-bridge.vala40
2 files changed, 19 insertions, 23 deletions
diff --git a/src/familiar-players-db.vala b/src/familiar-players-db.vala
index 2bc0a3c..894447c 100644
--- a/src/familiar-players-db.vala
+++ b/src/familiar-players-db.vala
@@ -83,7 +83,7 @@ public class FamiliarPlayersDB : GLib.Object
private bool load_data_from_key_file(){
try{
string[] desktops = this.key_file.get_string_list(GROUP_NAME,
- KEY_NAME);
+ KEY_NAME);
foreach(string s in desktops){
this.players_DB.set(s, true);
}
diff --git a/src/music-player-bridge.vala b/src/music-player-bridge.vala
index daad42f..c677d15 100644
--- a/src/music-player-bridge.vala
+++ b/src/music-player-bridge.vala
@@ -44,30 +44,26 @@ public class MusicPlayerBridge : GLib.Object
}
private void try_to_add_inactive_familiar_clients(){
- // TODO handle multple players - just working with one right now
- int count = 0;
foreach(string app in this.playersDB.records()){
- if(count == 0){
- if(app == null){
- warning("App string in keyfile is null therefore moving on to next player");
- continue;
- }
- DesktopAppInfo info = new DesktopAppInfo.from_filename(app);
- if(info == null){
- warning("Could not create a desktopappinfo instance from app: %s", app);
- continue;
- }
- GLib.AppInfo app_info = info as GLib.AppInfo;
- PlayerController ctrl = new PlayerController(this.root_menu,
- app_info.get_name(),
- calculate_menu_position(),
- PlayerController.state.OFFLINE);
- ctrl.set("app_info", app_info);
- this.registered_clients.set(app_info.get_name().down().strip(), ctrl);
- debug("Created a player controller for %s which was found in the cache file", app_info.get_name().down().strip());
- count += 1;
+ if(app == null){
+ warning("App string in keyfile is null therefore moving on to next player");
+ continue;
+ }
+
+ debug("attempting to make an app info from %s", app);
+
+ DesktopAppInfo info = new DesktopAppInfo.from_filename(app);
+ if(info == null){
+ warning("Could not create a desktopappinfo instance from app: %s", app);
+ continue;
}
- break;
+ GLib.AppInfo app_info = info as GLib.AppInfo;
+ PlayerController ctrl = new PlayerController(this.root_menu,
+ app_info.get_name(),
+ calculate_menu_position(),
+ PlayerController.state.OFFLINE);
+ ctrl.set("app_info", app_info);
+ this.registered_clients.set(app_info.get_name().down().strip(), ctrl);
}
}