Use lambdas for QtConcurrent::run instead of NewClosure

This commit is contained in:
Jonas Kvinge
2020-07-18 16:28:39 +02:00
parent 425dac478e
commit af67de8aa6
12 changed files with 25 additions and 47 deletions

View File

@@ -25,7 +25,7 @@
#include <algorithm>
#include <QtGlobal>
#include <QtConcurrentRun>
#include <QtConcurrent>
#include <QAbstractItemModel>
#include <QDialog>
#include <QScreen>
@@ -344,10 +344,9 @@ bool OrganiseDialog::SetUrls(const QList<QUrl> &urls) {
bool OrganiseDialog::SetFilenames(const QStringList &filenames) {
songs_future_ = QtConcurrent::run(this, &OrganiseDialog::LoadSongsBlocking, filenames);
NewClosure(songs_future_, [=]() { SetSongs(songs_future_.result()); });
SetLoadingSongs(true);
songs_future_ = QtConcurrent::run([=]{ SetSongs(LoadSongsBlocking(filenames)); });
return true;
}