Replace NewClosure with lamdas

This commit is contained in:
Jonas Kvinge
2021-01-29 18:47:50 +01:00
parent fd9c6d460a
commit cb5a7f8c9d
6 changed files with 10 additions and 9 deletions

View File

@@ -2064,7 +2064,8 @@ void MainWindow::RenumberTracks() {
if (song.IsEditable()) {
song.set_track(track);
TagReaderReply *reply = TagReaderClient::Instance()->SaveFile(song.url().toLocalFile(), song);
NewClosure(reply, SIGNAL(Finished(bool)), this, SLOT(SongSaveComplete(TagReaderReply*, QPersistentModelIndex)), reply, QPersistentModelIndex(source_index));
QPersistentModelIndex persistent_index = QPersistentModelIndex(source_index);
connect(reply, &TagReaderReply::Finished, this, [this, reply, persistent_index]() { SongSaveComplete(reply, persistent_index); });
}
++track;
}
@@ -2094,7 +2095,8 @@ void MainWindow::SelectionSetValue() {
if (!song.is_valid() || !song.url().isLocalFile()) continue;
if (Playlist::set_column_value(song, column, column_value)) {
TagReaderReply *reply = TagReaderClient::Instance()->SaveFile(song.url().toLocalFile(), song);
NewClosure(reply, SIGNAL(Finished(bool)), this, SLOT(SongSaveComplete(TagReaderReply*, QPersistentModelIndex)), reply, QPersistentModelIndex(source_index));
QPersistentModelIndex persistent_index = QPersistentModelIndex(source_index);
connect(reply, &TagReaderReply::Finished, this, [this, reply, persistent_index]() { SongSaveComplete(reply, persistent_index); });
}
}