Replace NewClosure with lamdas
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
#include "core/application.h"
|
||||
#include "core/player.h"
|
||||
#include "core/song.h"
|
||||
#include "core/closure.h"
|
||||
#include "engine/engine_fwd.h"
|
||||
#include "settings/moodbarsettingspage.h"
|
||||
#include "playlist/playlistmanager.h"
|
||||
@@ -76,7 +75,7 @@ void MoodbarController::CurrentSongChanged(const Song &song) {
|
||||
// bar. Our slot will be called when the data is actually loaded.
|
||||
emit CurrentMoodbarDataChanged(QByteArray());
|
||||
|
||||
NewClosure(pipeline, SIGNAL(Finished(bool)), this, SLOT(AsyncLoadComplete(MoodbarPipeline*, QUrl)), pipeline, song.url());
|
||||
QObject::connect(pipeline, &MoodbarPipeline::Finished, this, [this, pipeline, song]() { AsyncLoadComplete(pipeline, song.url()); });
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ void MoodbarItemDelegate::StartLoadingData(const QUrl &url, Data *data) {
|
||||
|
||||
case MoodbarLoader::WillLoadAsync:
|
||||
// Maybe in a little while.
|
||||
NewClosure(pipeline, SIGNAL(Finished(bool)), this, SLOT(DataLoaded(QUrl, MoodbarPipeline*)), url, pipeline);
|
||||
QObject::connect(pipeline, &MoodbarPipeline::Finished, this, [this, url, pipeline]() { DataLoaded(url, pipeline); });
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
#include <QtDebug>
|
||||
|
||||
#include "core/application.h"
|
||||
#include "core/closure.h"
|
||||
#include "core/logging.h"
|
||||
|
||||
#include "moodbarpipeline.h"
|
||||
@@ -130,7 +129,7 @@ MoodbarLoader::Result MoodbarLoader::Load(const QUrl &url, QByteArray *data, Moo
|
||||
// There was no existing file, analyze the audio file and create one.
|
||||
MoodbarPipeline *pipeline = new MoodbarPipeline(url);
|
||||
pipeline->moveToThread(thread_);
|
||||
NewClosure(pipeline, SIGNAL(Finished(bool)), this, SLOT(RequestFinished(MoodbarPipeline*, QUrl)), pipeline, url);
|
||||
QObject::connect(pipeline, &MoodbarPipeline::Finished, this, [this, pipeline, url]() { RequestFinished(pipeline, url); });
|
||||
|
||||
requests_[url] = pipeline;
|
||||
queued_requests_ << url;
|
||||
|
||||
Reference in New Issue
Block a user