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
1 changed files with 5 additions and 4 deletions

View File

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