aboutsummaryrefslogtreecommitdiff
path: root/src/music-player-bridge.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-10-15 13:59:45 +0100
committerConor Curran <conor.curran@canonical.com>2010-10-15 13:59:45 +0100
commit2d40c713f6d5fab70c952e757d0690c7dad63d2d (patch)
tree52afc42e2d6a857675ed4d4eec753afb75d995b5 /src/music-player-bridge.vala
parente2792ab0a1dfd8ca0c96b59b675fa09e8cd0e5d7 (diff)
downloadayatana-indicator-sound-2d40c713f6d5fab70c952e757d0690c7dad63d2d.tar.gz
ayatana-indicator-sound-2d40c713f6d5fab70c952e757d0690c7dad63d2d.tar.bz2
ayatana-indicator-sound-2d40c713f6d5fab70c952e757d0690c7dad63d2d.zip
updates done for now
Diffstat (limited to 'src/music-player-bridge.vala')
-rw-r--r--src/music-player-bridge.vala36
1 files changed, 5 insertions, 31 deletions
diff --git a/src/music-player-bridge.vala b/src/music-player-bridge.vala
index e109dec..9ab1b3c 100644
--- a/src/music-player-bridge.vala
+++ b/src/music-player-bridge.vala
@@ -56,17 +56,12 @@ public class MusicPlayerBridge : GLib.Object
GLib.AppInfo app_info = info as GLib.AppInfo;
PlayerController ctrl = new PlayerController(this.root_menu,
- truncate_player_name(app_info.get_name()),
+ app_info,
+ playersDB.fetch_icon_name(app),
calculate_menu_position(),
PlayerController.state.OFFLINE);
ctrl.app_info = app_info;
- if(ctrl.app_info == null){
- warning("for some reason the app info is null");
- }
- else{
- ctrl.set_icon_path();
- }
- this.registered_clients.set(determine_key(app), ctrl);
+ this.registered_clients.set(determine_key(app), ctrl);
}
}
@@ -96,22 +91,14 @@ public class MusicPlayerBridge : GLib.Object
{
MusicPlayerBridge bridge = data as MusicPlayerBridge;
AppInfo? app_info = create_app_info(path);
- var name = truncate_player_name(app_info.get_name());
if(path.contains("/") && bridge.playersDB.already_familiar(path) == false){
debug("About to store desktop file path: %s", path);
bridge.playersDB.insert(path);
PlayerController ctrl = new PlayerController(bridge.root_menu,
- name,
+ app_info,
+ playersDB.fetch_icon_name(path),
bridge.calculate_menu_position(),
PlayerController.state.READY);
- ctrl.set("app_info", app_info);
- if(ctrl.app_info == null){
- warning("for some reason the app info is null");
- }
- else{
- ctrl.set_icon_path();
- }
-
bridge.registered_clients.set(determine_key(path), ctrl);
debug("successfully created appinfo and instance from path and set it on the respective instance");
}
@@ -163,19 +150,6 @@ public class MusicPlayerBridge : GLib.Object
return app_info;
}
- private static string truncate_player_name(owned string app_info_name)
- {
- string result = app_info_name.down().strip();
-
- var tokens = result.split(" ");
-
- if(tokens.length > 1){
- result = tokens[0];
- }
- debug("truncate player name %s", result);
- return result;
- }
-
private static string? determine_key(owned string path)
{
var tokens = path.split("/");