aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-10-07 12:08:22 +0100
committerConor Curran <conor.curran@canonical.com>2010-10-07 12:08:22 +0100
commit351ec423689a0841a3ab9cc6fe03f3dcef5028bc (patch)
tree1ede87be6379b3461b85c45b2270a557a5698c1f
parent17adc8728d70bf02fd455f5cb37e49ae9244942b (diff)
downloadayatana-indicator-sound-351ec423689a0841a3ab9cc6fe03f3dcef5028bc.tar.gz
ayatana-indicator-sound-351ec423689a0841a3ab9cc6fe03f3dcef5028bc.tar.bz2
ayatana-indicator-sound-351ec423689a0841a3ab9cc6fe03f3dcef5028bc.zip
tidy up in the music controller vala
-rw-r--r--src/music-player-bridge.vala55
1 files changed, 28 insertions, 27 deletions
diff --git a/src/music-player-bridge.vala b/src/music-player-bridge.vala
index aad6e47..9ba4ef6 100644
--- a/src/music-player-bridge.vala
+++ b/src/music-player-bridge.vala
@@ -66,33 +66,6 @@ public class MusicPlayerBridge : GLib.Object
this.registered_clients.set(determine_key(app), ctrl);
}
}
-
- private static string truncate_player_name(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(string path)
- {
- 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];
- }
- debug("determine key result = %s", result);
- return result;
- }
private int calculate_menu_position()
{
@@ -179,6 +152,34 @@ public class MusicPlayerBridge : GLib.Object
GLib.AppInfo app_info = info as GLib.AppInfo;
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("/");
+ 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];
+ }
+ debug("determine key result = %s", result);
+ return result;
+ }
+
}