Merge lp:~cjcurran/indicator-sound/mpris-interface-name-translation-fix into lp:indicator-sound/sound-menu-v2

Proposed by Conor Curran
Status: Merged
Merged at revision: 149
Proposed branch: lp:~cjcurran/indicator-sound/mpris-interface-name-translation-fix
Merge into: lp:indicator-sound/sound-menu-v2
Diff against target: 71 lines (+8/-3)
3 files modified
src/mpris2-controller.vala (+3/-3)
src/music-player-bridge.vala (+2/-0)
src/player-controller.vala (+3/-0)
To merge this branch: bzr merge lp:~cjcurran/indicator-sound/mpris-interface-name-translation-fix
Reviewer Review Type Date Requested Status
David Barth Approve
Review via email: mp+38409@code.launchpad.net

Description of the change

Fixes the regression causes by the initial fix for this bug ->
https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/654140

"Omer: Yes, I did and also reboot. Please note that if you didn't have the translated text problem, this new problem also probably doesn't affect you. It's now certainly something that used to use the application name "Rhythmbox" to send the signals, but now that the translated name is used the control signals no more go through (since they should probably still be sent with the original application name instead of the translated name)."

To post a comment you must log in.
Revision history for this message
David Barth (dbarth) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/mpris2-controller.vala'
2--- src/mpris2-controller.vala 2010-10-07 13:22:09 +0000
3+++ src/mpris2-controller.vala 2010-10-14 11:58:40 +0000
4@@ -75,10 +75,10 @@
5 construct{
6 try {
7 var connection = DBus.Bus.get (DBus.BusType.SESSION);
8- this.mpris2_root = (MprisRoot) connection.get_object (root_interface.concat(".").concat(this.owner.name.down()),
9+ this.mpris2_root = (MprisRoot) connection.get_object (root_interface.concat(".").concat(this.owner.mpris_name),
10 "/org/mpris/MediaPlayer2",
11 root_interface);
12- this.player = (MprisPlayer) connection.get_object (root_interface.concat(".").concat(this.owner.name.down()),
13+ this.player = (MprisPlayer) connection.get_object (root_interface.concat(".").concat(this.owner.mpris_name),
14 "/org/mpris/MediaPlayer2",
15 root_interface.concat(".Player"));
16 this.properties_interface = (FreeDesktopProperties) connection.get_object("org.freedesktop.Properties.PropertiesChanged",
17@@ -92,7 +92,7 @@
18
19 public void property_changed_cb(string interface_source, HashTable<string, Value?> changed_properties, string[] invalid )
20 {
21- debug("properties-changed for interface %s and owner %s", interface_source, this.owner.name.down());
22+ debug("properties-changed for interface %s and owner %s", interface_source, this.owner.mpris_name);
23
24 if(changed_properties == null || interface_source.has_prefix(this.root_interface) == false ){
25 warning("Property-changed hash is null or this is an interface that doesn't concerns us");
26
27=== modified file 'src/music-player-bridge.vala'
28--- src/music-player-bridge.vala 2010-10-07 11:08:22 +0000
29+++ src/music-player-bridge.vala 2010-10-14 11:58:40 +0000
30@@ -58,6 +58,7 @@
31 GLib.AppInfo app_info = info as GLib.AppInfo;
32 PlayerController ctrl = new PlayerController(this.root_menu,
33 truncate_player_name(app_info.get_name()),
34+ determine_key(app),
35 calculate_menu_position(),
36 PlayerController.state.OFFLINE);
37 ctrl.app_info = app_info;
38@@ -99,6 +100,7 @@
39 bridge.playersDB.insert(path);
40 PlayerController ctrl = new PlayerController(bridge.root_menu,
41 name,
42+ determine_key(path),
43 bridge.calculate_menu_position(),
44 PlayerController.state.READY);
45 ctrl.set("app_info", app_info);
46
47=== modified file 'src/player-controller.vala'
48--- src/player-controller.vala 2010-10-07 10:59:41 +0000
49+++ src/player-controller.vala 2010-10-14 11:58:40 +0000
50@@ -44,6 +44,7 @@
51
52 private Dbusmenu.Menuitem root_menu;
53 public string name { get; set;}
54+ public string mpris_name { get; set;}
55 public ArrayList<PlayerItem> custom_items;
56 public Mpris2Controller mpris_bridge;
57 public AppInfo? app_info { get; set;}
58@@ -51,11 +52,13 @@
59
60 public PlayerController(Dbusmenu.Menuitem root,
61 string client_name,
62+ string mpris_name,
63 int offset,
64 state initial_state)
65 {
66 this.root_menu = root;
67 this.name = format_client_name(client_name.strip());
68+ this.mpris_name = mpris_name;
69 this.custom_items = new ArrayList<PlayerItem>();
70 this.current_state = initial_state;
71 this.menu_offset = offset;

Subscribers

People subscribed via source and target branches

to all changes: