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
=== modified file 'src/mpris2-controller.vala'
--- src/mpris2-controller.vala 2010-10-07 13:22:09 +0000
+++ src/mpris2-controller.vala 2010-10-14 11:58:40 +0000
@@ -75,10 +75,10 @@
75 construct{75 construct{
76 try {76 try {
77 var connection = DBus.Bus.get (DBus.BusType.SESSION);77 var connection = DBus.Bus.get (DBus.BusType.SESSION);
78 this.mpris2_root = (MprisRoot) connection.get_object (root_interface.concat(".").concat(this.owner.name.down()),78 this.mpris2_root = (MprisRoot) connection.get_object (root_interface.concat(".").concat(this.owner.mpris_name),
79 "/org/mpris/MediaPlayer2",79 "/org/mpris/MediaPlayer2",
80 root_interface); 80 root_interface);
81 this.player = (MprisPlayer) connection.get_object (root_interface.concat(".").concat(this.owner.name.down()),81 this.player = (MprisPlayer) connection.get_object (root_interface.concat(".").concat(this.owner.mpris_name),
82 "/org/mpris/MediaPlayer2",82 "/org/mpris/MediaPlayer2",
83 root_interface.concat(".Player")); 83 root_interface.concat(".Player"));
84 this.properties_interface = (FreeDesktopProperties) connection.get_object("org.freedesktop.Properties.PropertiesChanged",84 this.properties_interface = (FreeDesktopProperties) connection.get_object("org.freedesktop.Properties.PropertiesChanged",
@@ -92,7 +92,7 @@
9292
93 public void property_changed_cb(string interface_source, HashTable<string, Value?> changed_properties, string[] invalid )93 public void property_changed_cb(string interface_source, HashTable<string, Value?> changed_properties, string[] invalid )
94 { 94 {
95 debug("properties-changed for interface %s and owner %s", interface_source, this.owner.name.down());95 debug("properties-changed for interface %s and owner %s", interface_source, this.owner.mpris_name);
96 96
97 if(changed_properties == null || interface_source.has_prefix(this.root_interface) == false ){97 if(changed_properties == null || interface_source.has_prefix(this.root_interface) == false ){
98 warning("Property-changed hash is null or this is an interface that doesn't concerns us");98 warning("Property-changed hash is null or this is an interface that doesn't concerns us");
9999
=== modified file 'src/music-player-bridge.vala'
--- src/music-player-bridge.vala 2010-10-07 11:08:22 +0000
+++ src/music-player-bridge.vala 2010-10-14 11:58:40 +0000
@@ -58,6 +58,7 @@
58 GLib.AppInfo app_info = info as GLib.AppInfo;58 GLib.AppInfo app_info = info as GLib.AppInfo;
59 PlayerController ctrl = new PlayerController(this.root_menu, 59 PlayerController ctrl = new PlayerController(this.root_menu,
60 truncate_player_name(app_info.get_name()),60 truncate_player_name(app_info.get_name()),
61 determine_key(app),
61 calculate_menu_position(),62 calculate_menu_position(),
62 PlayerController.state.OFFLINE);63 PlayerController.state.OFFLINE);
63 ctrl.app_info = app_info;64 ctrl.app_info = app_info;
@@ -99,6 +100,7 @@
99 bridge.playersDB.insert(path);100 bridge.playersDB.insert(path);
100 PlayerController ctrl = new PlayerController(bridge.root_menu,101 PlayerController ctrl = new PlayerController(bridge.root_menu,
101 name,102 name,
103 determine_key(path),
102 bridge.calculate_menu_position(),104 bridge.calculate_menu_position(),
103 PlayerController.state.READY);105 PlayerController.state.READY);
104 ctrl.set("app_info", app_info);106 ctrl.set("app_info", app_info);
105107
=== modified file 'src/player-controller.vala'
--- src/player-controller.vala 2010-10-07 10:59:41 +0000
+++ src/player-controller.vala 2010-10-14 11:58:40 +0000
@@ -44,6 +44,7 @@
44 44
45 private Dbusmenu.Menuitem root_menu;45 private Dbusmenu.Menuitem root_menu;
46 public string name { get; set;} 46 public string name { get; set;}
47 public string mpris_name { get; set;}
47 public ArrayList<PlayerItem> custom_items; 48 public ArrayList<PlayerItem> custom_items;
48 public Mpris2Controller mpris_bridge;49 public Mpris2Controller mpris_bridge;
49 public AppInfo? app_info { get; set;}50 public AppInfo? app_info { get; set;}
@@ -51,11 +52,13 @@
51 52
52 public PlayerController(Dbusmenu.Menuitem root,53 public PlayerController(Dbusmenu.Menuitem root,
53 string client_name,54 string client_name,
55 string mpris_name,
54 int offset,56 int offset,
55 state initial_state)57 state initial_state)
56 {58 {
57 this.root_menu = root;59 this.root_menu = root;
58 this.name = format_client_name(client_name.strip());60 this.name = format_client_name(client_name.strip());
61 this.mpris_name = mpris_name;
59 this.custom_items = new ArrayList<PlayerItem>();62 this.custom_items = new ArrayList<PlayerItem>();
60 this.current_state = initial_state;63 this.current_state = initial_state;
61 this.menu_offset = offset;64 this.menu_offset = offset;

Subscribers

People subscribed via source and target branches

to all changes: