Try out actually using lambdas for something useful.
This commit is contained in:
parent
c7459b1b28
commit
b3ef8b0fe0
|
@ -155,7 +155,10 @@ bool OrganiseDialog::SetFilenames(const QStringList& filenames) {
|
|||
QtConcurrent::run(this, &OrganiseDialog::LoadSongsBlocking, filenames);
|
||||
QFutureWatcher<SongList>* watcher = new QFutureWatcher<SongList>(this);
|
||||
watcher->setFuture(songs_future_);
|
||||
connect(watcher, SIGNAL(finished()), SLOT(LoadSongsFinished()));
|
||||
NewClosure(watcher, SIGNAL(finished()), [&]() {
|
||||
SetSongs(songs_future_.result());
|
||||
watcher->deleteLater();
|
||||
});
|
||||
|
||||
SetLoadingSongs(true);
|
||||
return true;
|
||||
|
@ -171,8 +174,6 @@ void OrganiseDialog::SetLoadingSongs(bool loading) {
|
|||
}
|
||||
}
|
||||
|
||||
void OrganiseDialog::LoadSongsFinished() { SetSongs(songs_future_.result()); }
|
||||
|
||||
SongList OrganiseDialog::LoadSongsBlocking(const QStringList& filenames) {
|
||||
SongList songs;
|
||||
Song song;
|
||||
|
|
|
@ -73,7 +73,6 @@ class OrganiseDialog : public QDialog {
|
|||
void InsertTag(const QString& tag);
|
||||
void UpdatePreviews();
|
||||
|
||||
void LoadSongsFinished();
|
||||
void OrganiseFinished(const QStringList& files_with_errors);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue