From 5b066991abc517d219aba92b46fee4c495221635 Mon Sep 17 00:00:00 2001 From: Victor Dodon Date: Thu, 10 Mar 2016 21:20:53 +0000 Subject: [PATCH] playlist: call InformOfCurrentSongChange only after updating the virtual index Calling InformOfCurrentSongChange before updating the virtual index results in sending the CanGoNext and CanGoPrevious notifications with the wrong values. --- src/playlist/playlist.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/playlist/playlist.cpp b/src/playlist/playlist.cpp index 42b68ebef..c653a5528 100644 --- a/src/playlist/playlist.cpp +++ b/src/playlist/playlist.cpp @@ -633,10 +633,6 @@ void Playlist::set_current_row(int i, bool is_stopping) { old_current_item_index.row(), ColumnCount - 1)); } - if (current_item_index_.isValid() && !is_stopping) { - InformOfCurrentSongChange(); - } - // Update the virtual index if (i == -1) { current_virtual_index_ = -1; @@ -655,6 +651,10 @@ void Playlist::set_current_row(int i, bool is_stopping) { current_virtual_index_ = i; } + if (current_item_index_.isValid() && !is_stopping) { + InformOfCurrentSongChange(); + } + // The structure of a dynamic playlist is as follows: // history - active song - future // We have to ensure that this invariant is maintained.