1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-15 10:48:33 +01:00

Renumber tracks correctly starting from the top one even when the user selects them "backwards" (starting from the bottom).

This commit is contained in:
David Sansome 2010-04-27 17:15:11 +00:00
parent 30daf4aca2
commit 3f360d254f

View File

@ -800,6 +800,9 @@ void MainWindow::RenumberTracks() {
QModelIndexList indexes=ui_.playlist->selectionModel()->selection().indexes();
int track=1;
// Get the index list in order
qStableSort(indexes);
// if first selected song has a track number set, start from that offset
if (indexes.size()) {
Song first_song=playlist_->item_at(indexes[0].row())->Metadata();