mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-18 20:34:39 +01:00
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
Block a user