diff options
author | Conor Curran <conor.curran@canonical.com> | 2010-12-06 13:22:26 +0000 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2010-12-06 13:22:26 +0000 |
commit | 65127a75569ae72173423510dedbc639f71cd9ba (patch) | |
tree | d18dd2893ced8b11c1f4427210926e3ea2056877 /src | |
parent | 91aa96835684880832c8e535798ebeb6dcca4039 (diff) | |
download | ayatana-indicator-sound-65127a75569ae72173423510dedbc639f71cd9ba.tar.gz ayatana-indicator-sound-65127a75569ae72173423510dedbc639f71cd9ba.tar.bz2 ayatana-indicator-sound-65127a75569ae72173423510dedbc639f71cd9ba.zip |
registration working now but menuitems are unresponsive, now to move over to the new dbusmenu
Diffstat (limited to 'src')
-rw-r--r-- | src/music-player-bridge.vala | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/music-player-bridge.vala b/src/music-player-bridge.vala index 8124021..c905c12 100644 --- a/src/music-player-bridge.vala +++ b/src/music-player-bridge.vala @@ -52,7 +52,7 @@ public class MusicPlayerBridge : GLib.Object } GLib.AppInfo app_info = info as GLib.AppInfo; - var mpris_key = determine_key(app); + var mpris_key = determine_key ( app ); PlayerController ctrl = new PlayerController(this.root_menu, app_info, mpris_key, @@ -93,7 +93,7 @@ public class MusicPlayerBridge : GLib.Object return; } - var mpris_key = determine_key ( desktop_file_name ); + var mpris_key = determine_key ( path ); if ( this.playersDB.already_familiar ( path ) == false ){ debug("New client has registered that we have not seen before: %s", desktop_file_name ); @@ -148,10 +148,13 @@ public class MusicPlayerBridge : GLib.Object return app_info; } - private static string? determine_key(owned string name) + private static string? determine_key(owned string path) { - string result = name; - var temp = name.split("-"); + var tokens = path.split("/"); + if ( tokens.length < 2) return null; + var filename = tokens[tokens.length - 1]; + var result = filename.split(".")[0]; + var temp = result.split("-"); if (temp.length > 1){ result = temp[0]; } |