PlaylistView: Set current index when automatically selecting track
Fixes #1825
This commit is contained in:
@@ -1445,9 +1445,9 @@ void PlaylistView::SongChanged(const Song &song) {
|
|||||||
song_playing_ = song;
|
song_playing_ = song;
|
||||||
|
|
||||||
if (select_track_ && playlist_) {
|
if (select_track_ && playlist_) {
|
||||||
clearSelection();
|
const QModelIndex current_index = playlist_->filter()->mapFromSource(playlist_->index(playlist_->current_row(), 0));
|
||||||
QItemSelection selection(playlist_->index(playlist_->current_row(), 0), playlist_->index(playlist_->current_row(), Playlist::ColumnCount - 1));
|
if (!current_index.isValid()) return;
|
||||||
selectionModel()->select(selection, QItemSelectionModel::Select);
|
selectionModel()->setCurrentIndex(current_index, QItemSelectionModel::ClearAndSelect|QItemSelectionModel::Rows);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user