Set next track as current when removing tracks

Fixes #5031
Attempt to set the song after the deleted tracks as the current so that they will play next rather than the beginning of the playlist.
This commit is contained in:
Mark Furneaux 2015-11-23 01:48:48 -05:00
parent 4393f7e53f
commit 9b42ee50ef
1 changed files with 5 additions and 1 deletions

View File

@ -1647,7 +1647,11 @@ PlaylistItemList Playlist::RemoveItemsWithoutUndo(int row, int count) {
// Reset current_virtual_index_
if (current_row() == -1)
current_virtual_index_ = -1;
if (row - 1 > 0 && row - 1 < items_.size()) {
current_virtual_index_ = virtual_items_.indexOf(row - 1);
} else {
current_virtual_index_ = -1;
}
else
current_virtual_index_ = virtual_items_.indexOf(current_row());