1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-17 20:09:50 +01:00

When renumbering tracks, only start from the track number of the first track if it's greater than 0. Fixes issue 2072

This commit is contained in:
David Sansome 2011-08-27 22:43:02 +01:00
parent 7f7451b72a
commit 2f63130606

View File

@ -1445,10 +1445,11 @@ void MainWindow::RenumberTracks() {
qStableSort(indexes); qStableSort(indexes);
// if first selected song has a track number set, start from that offset // if first selected song has a track number set, start from that offset
if (indexes.size()) { if (!indexes.isEmpty()) {
Song first_song=playlists_->current()->item_at(indexes[0].row())->Metadata(); const Song first_song = playlists_->current()->item_at(indexes[0].row())->Metadata();
if (int first_track = first_song.track())
track = first_track; if (first_song.track() > 0)
track = first_song.track();
} }
foreach (const QModelIndex& index, indexes) { foreach (const QModelIndex& index, indexes) {