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.
This commit is contained in:
parent
5f14e887a7
commit
5b066991ab
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user