Merge lp:~xavi-garcia-mena/indicator-sound/bug-1245495-playback-controls-with-playlist into lp:indicator-sound/15.10

Proposed by Xavi Garcia
Status: Merged
Approved by: Charles Kerr
Approved revision: 524
Merged at revision: 524
Proposed branch: lp:~xavi-garcia-mena/indicator-sound/bug-1245495-playback-controls-with-playlist
Merge into: lp:indicator-sound/15.10
Diff against target: 19 lines (+4/-3)
1 file modified
src/sound-menu.vala (+4/-3)
To merge this branch: bzr merge lp:~xavi-garcia-mena/indicator-sound/bug-1245495-playback-controls-with-playlist
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Charles Kerr (community) Approve
Review via email: mp+283339@code.launchpad.net

Commit message

Fixing the playback controls when we have the playlist as the last item in the player section.
As number of items was 3 when having the playlist section we were not updating the player controls and the next/previous buttons were not working at all.

Description of the change

Fixing the playback controls when we have the playlist as the last item in the player section.
As number of items was 3 when having the playlist section we were not updating the player controls and the next/previous buttons were not working at all.

To post a comment you must log in.
Revision history for this message
Charles Kerr (charlesk) wrote :

This manual indexing in update_player_section() is so ugly. Not new with this patch though :)

In terms of addressing Bug #1245495 with a minimal diff, LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/sound-menu.vala'
2--- src/sound-menu.vala 2016-01-07 05:28:51 +0000
3+++ src/sound-menu.vala 2016-01-20 17:20:44 +0000
4@@ -339,12 +339,13 @@
5
6 void update_player_section (MediaPlayer player, int index) {
7 var player_section = this.menu.get_item_link(index, Menu.LINK_SECTION) as Menu;
8- if (player_section.get_n_items () == 2) {
9+ if (player_section.get_n_items () == 2 || player_section.get_n_items () == 3) {
10 // we have 2 items, the second one is the playback item
11- // remove it first
12+ // if we have 3 items, it means we also have the playlist item.
13+ // remove the playbak item first
14 player_section.remove (1);
15 MenuItem playback_item = create_playback_menu_item (player);
16- player_section.append_item (playback_item);
17+ player_section.insert_item (1, playback_item);
18 }
19 }
20

Subscribers

People subscribed via source and target branches