Skip to content

Commit

Permalink
Try out actually using lambdas for something useful.
Browse files Browse the repository at this point in the history
  • Loading branch information
hatstand committed Apr 23, 2014
1 parent c7459b1 commit b3ef8b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/ui/organisedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/ui/organisedialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b3ef8b0

Please sign in to comment.