Merge lp:~cjcurran/indicator-sound/fixes-945827 into lp:indicator-sound/fifth

Proposed by Conor Curran on 2012-03-19
Status: Merged
Approved by: Charles Kerr on 2012-03-19
Approved revision: 314
Merge reported by: Charles Kerr
Merged at revision: not available
Proposed branch: lp:~cjcurran/indicator-sound/fixes-945827
Merge into: lp:indicator-sound/fifth
Diff against target: 71 lines (+21/-5)
3 files modified
src/metadata-widget.c (+1/-1)
src/mpris2-controller.vala (+19/-3)
src/mpris2-interfaces.vala (+1/-1)
To merge this branch: bzr merge lp:~cjcurran/indicator-sound/fixes-945827
Reviewer Review Type Date Requested Status
Charles Kerr (community) 2012-03-19 Approve on 2012-03-19
Review via email: mp+98252@code.launchpad.net

Description of the change

Attempts to be completely paranoid when dealing with the ActivePlaylist property on the MPRIS playlists interface. Tweaks the padding on the player label by 1 pixel.

To post a comment you must log in.
Charles Kerr (charlesk) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/metadata-widget.c'
2--- src/metadata-widget.c 2012-03-17 00:37:32 +0000
3+++ src/metadata-widget.c 2012-03-19 18:39:20 +0000
4@@ -228,7 +228,7 @@
5 GtkWidget* player_label;
6 player_label = gtk_label_new ("");
7 gtk_misc_set_alignment(GTK_MISC(player_label), (gfloat)0, (gfloat)0);
8- gtk_misc_set_padding (GTK_MISC(player_label), (gfloat)1, (gfloat)4);
9+ gtk_misc_set_padding (GTK_MISC(player_label), (gfloat)1, (gfloat)3);
10 gtk_widget_set_size_request (player_label, 150, 24);
11 priv->player_label = player_label;
12
13
14=== modified file 'src/mpris2-controller.vala'
15--- src/mpris2-controller.vala 2012-02-29 21:05:26 +0000
16+++ src/mpris2-controller.vala 2012-03-19 18:39:20 +0000
17@@ -92,7 +92,7 @@
18 }
19 Variant? playlist_v = changed_properties.lookup("ActivePlaylist");
20 if ( playlist_v != null && this.owner.use_playlists == true ){
21- Timeout.add (300, this.fetch_active_playlist);
22+ Timeout.add (500, this.fetch_active_playlist);
23 }
24 Variant? playlist_count_v = changed_properties.lookup("PlaylistCount");
25 if ( playlist_count_v != null && this.owner.use_playlists == true ){
26@@ -240,14 +240,30 @@
27 playlists_item.update(current_playlists);
28 }
29 else{
30- warning(" Playlists are on but its returning no current_playlists" );
31+ warning(" Playlists are on but %s is returning no current_playlists ?",
32+ this.owner.app_info.get_name());
33 this.owner.use_playlists = false;
34 }
35 }
36
37+ private bool validate_playlists_details()
38+ {
39+ if (this.playlists.ActivePlaylist.valid == false){
40+ return false;
41+ }
42+ if (this.playlists.ActivePlaylist.details == null){
43+ return false;
44+ }
45+ if (this.playlists.ActivePlaylist.details.path == null ||
46+ this.playlists.ActivePlaylist.details.name == null){
47+ return false;
48+ }
49+ return true;
50+ }
51+
52 private bool fetch_active_playlist()
53 {
54- if (this.playlists.ActivePlaylist.valid == false){
55+ if (this.validate_playlists_details() == false){
56 return false;
57 }
58 PlaylistsMenuitem playlists_item = this.owner.custom_items[PlayerController.widget_order.PLAYLISTS] as PlaylistsMenuitem;
59
60=== modified file 'src/mpris2-interfaces.vala'
61--- src/mpris2-interfaces.vala 2012-03-12 15:56:26 +0000
62+++ src/mpris2-interfaces.vala 2012-03-19 18:39:20 +0000
63@@ -65,7 +65,7 @@
64 //properties
65 public abstract string[] Orderings{owned get; set;}
66 public abstract uint32 PlaylistCount{owned get; set;}
67- public abstract ActivePlaylistContainer ActivePlaylist {owned get; set;}
68+ public abstract ActivePlaylistContainer? ActivePlaylist {owned get; set;}
69
70 //methods
71 public abstract async void ActivatePlaylist(ObjectPath playlist_id) throws IOError;

Subscribers

People subscribed via source and target branches