Replace closures with connect variant.
Qt5 introduced new connect variants that allow calling a functor. A lambda can replace the user of the Closure class in this case.
This commit is contained in:
parent
b3ec030ae4
commit
941e139a18
|
@ -26,7 +26,6 @@
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QUrlQuery>
|
#include <QUrlQuery>
|
||||||
|
|
||||||
#include "core/closure.h"
|
|
||||||
#include "core/logging.h"
|
#include "core/logging.h"
|
||||||
#include "songkickconcertwidget.h"
|
#include "songkickconcertwidget.h"
|
||||||
#include "ui/iconloader.h"
|
#include "ui/iconloader.h"
|
||||||
|
@ -62,8 +61,8 @@ void SongkickConcerts::FetchInfo(int id, const Song& metadata) {
|
||||||
|
|
||||||
QNetworkRequest request(url);
|
QNetworkRequest request(url);
|
||||||
QNetworkReply* reply = network_.get(request);
|
QNetworkReply* reply = network_.get(request);
|
||||||
NewClosure(reply, SIGNAL(finished()), this,
|
connect(reply, &QNetworkReply::finished,
|
||||||
SLOT(ArtistSearchFinished(QNetworkReply*, int)), reply, id);
|
[=] { this->ArtistSearchFinished(reply, id); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void SongkickConcerts::ArtistSearchFinished(QNetworkReply* reply, int id) {
|
void SongkickConcerts::ArtistSearchFinished(QNetworkReply* reply, int id) {
|
||||||
|
@ -111,8 +110,8 @@ void SongkickConcerts::FetchSongkickCalendar(const QString& artist_id, int id) {
|
||||||
url.setQuery(url_query);
|
url.setQuery(url_query);
|
||||||
qLog(Debug) << url;
|
qLog(Debug) << url;
|
||||||
QNetworkReply* reply = network_.get(QNetworkRequest(url));
|
QNetworkReply* reply = network_.get(QNetworkRequest(url));
|
||||||
NewClosure(reply, SIGNAL(finished()), this,
|
connect(reply, &QNetworkReply::finished,
|
||||||
SLOT(CalendarRequestFinished(QNetworkReply*, int)), reply, id);
|
[=] { this->CalendarRequestFinished(reply, id); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void SongkickConcerts::CalendarRequestFinished(QNetworkReply* reply, int id) {
|
void SongkickConcerts::CalendarRequestFinished(QNetworkReply* reply, int id) {
|
||||||
|
|
Loading…
Reference in New Issue