Non-const references put me on santa's naughty list
This commit is contained in:
parent
c2bd0bbb05
commit
e21307e087
@ -527,13 +527,13 @@ void EditTagDialog::SetAlbumArt(const QString& path) {
|
|||||||
const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes();
|
const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes();
|
||||||
if (sel.isEmpty())
|
if (sel.isEmpty())
|
||||||
return;
|
return;
|
||||||
Song& song = data_[sel.first().row()].original_;
|
Song* song = &data_[sel.first().row()].original_;
|
||||||
if (!song.is_valid() || song.id() == -1)
|
if (!song->is_valid() || song->id() == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
song.set_art_manual(path);
|
song->set_art_manual(path);
|
||||||
backend_->UpdateManualAlbumArtAsync(song.artist(), song.album(), path);
|
backend_->UpdateManualAlbumArtAsync(song->artist(), song->album(), path);
|
||||||
UpdateSummaryTab(song);
|
UpdateSummaryTab(*song);
|
||||||
|
|
||||||
// Now check if we have any other songs cached that share that artist and
|
// Now check if we have any other songs cached that share that artist and
|
||||||
// album (and would therefore be changed as well)
|
// album (and would therefore be changed as well)
|
||||||
@ -541,10 +541,10 @@ void EditTagDialog::SetAlbumArt(const QString& path) {
|
|||||||
if (i == sel.first().row()) // Already changed this one
|
if (i == sel.first().row()) // Already changed this one
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Song& other_song = data_[i].original_;
|
Song* other_song = &data_[i].original_;
|
||||||
if (song.artist() == other_song.artist() &&
|
if (song->artist() == other_song->artist() &&
|
||||||
song.album() == other_song.album()) {
|
song->album() == other_song->album()) {
|
||||||
other_song.set_art_manual(path);
|
other_song->set_art_manual(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -619,10 +619,10 @@ void EditTagDialog::SongRated(float rating) {
|
|||||||
const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes();
|
const QModelIndexList sel = ui_->song_list->selectionModel()->selectedIndexes();
|
||||||
if (sel.isEmpty())
|
if (sel.isEmpty())
|
||||||
return;
|
return;
|
||||||
Song& song = data_[sel.first().row()].original_;
|
Song* song = &data_[sel.first().row()].original_;
|
||||||
if (!song.is_valid() || song.id() == -1)
|
if (!song->is_valid() || song->id() == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
song.set_rating(rating);
|
song->set_rating(rating);
|
||||||
backend_->UpdateSongRatingAsync(song.id(), rating);
|
backend_->UpdateSongRatingAsync(song->id(), rating);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user