Use 4arg connects for networkreplies

This commit is contained in:
Jonas Kvinge
2021-03-21 00:37:17 +01:00
parent 73eebd6162
commit b224aeb0d8
30 changed files with 58 additions and 58 deletions

View File

@@ -288,7 +288,7 @@ void AlbumCoverFetcherSearch::FetchMoreImages() {
req.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
#endif
QNetworkReply *image_reply = network_->get(req);
QObject::connect(image_reply, &QNetworkReply::finished, [this, image_reply]() { ProviderCoverFetchFinished(image_reply); });
QObject::connect(image_reply, &QNetworkReply::finished, this, [this, image_reply]() { ProviderCoverFetchFinished(image_reply); });
pending_image_loads_[image_reply] = result;
image_load_timeout_->AddReply(image_reply);

View File

@@ -468,7 +468,7 @@ AlbumCoverLoader::TryLoadResult AlbumCoverLoader::TryLoadImage(Task *task) {
request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
#endif
QNetworkReply *reply = network_->get(request);
QObject::connect(reply, &QNetworkReply::finished, [this, reply, cover_url]() { RemoteFetchFinished(reply, cover_url); });
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, cover_url]() { RemoteFetchFinished(reply, cover_url); });
remote_tasks_.insert(reply, *task);
return TryLoadResult(true, false, type, AlbumCoverImageResult(cover_url));
@@ -500,7 +500,7 @@ void AlbumCoverLoader::RemoteFetchFinished(QNetworkReply *reply, const QUrl &cov
#endif
request.setUrl(redirect.toUrl());
QNetworkReply *redirected_reply = network_->get(request);
QObject::connect(redirected_reply, &QNetworkReply::finished, [this, redirected_reply, redirect]() { RemoteFetchFinished(redirected_reply, redirect.toUrl()); });
QObject::connect(redirected_reply, &QNetworkReply::finished, this, [this, redirected_reply, redirect]() { RemoteFetchFinished(redirected_reply, redirect.toUrl()); });
remote_tasks_.insert(redirected_reply, task);
return;

View File

@@ -107,7 +107,7 @@ bool DeezerCoverProvider::StartSearch(const QString &artist, const QString &albu
#endif
QNetworkReply *reply = network_->get(req);
replies_ << reply;
QObject::connect(reply, &QNetworkReply::finished, [this, reply, id]() { HandleSearchReply(reply, id); });
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, id]() { HandleSearchReply(reply, id); });
return true;

View File

@@ -144,7 +144,7 @@ void DiscogsCoverProvider::SendSearchRequest(std::shared_ptr<DiscogsCoverSearchC
}
QNetworkReply *reply = CreateRequest(QUrl(kUrlSearch), params);
QObject::connect(reply, &QNetworkReply::finished, [this, reply, search]() { HandleSearchReply(reply, search->id); });
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, search]() { HandleSearchReply(reply, search->id); });
}
@@ -331,7 +331,7 @@ void DiscogsCoverProvider::StartReleaseRequest(std::shared_ptr<DiscogsCoverSearc
void DiscogsCoverProvider::SendReleaseRequest(const DiscogsCoverReleaseContext release) {
QNetworkReply *reply = CreateRequest(release.url);
QObject::connect(reply, &QNetworkReply::finished, [this, reply, release]() { HandleReleaseReply(reply, release.search_id, release.id); } );
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, release]() { HandleReleaseReply(reply, release.search_id, release.id); } );
}

View File

@@ -122,7 +122,7 @@ bool LastFmCoverProvider::StartSearch(const QString &artist, const QString &albu
req.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
QNetworkReply *reply = network_->post(req, url_query.toString(QUrl::FullyEncoded).toUtf8());
replies_ << reply;
QObject::connect(reply, &QNetworkReply::finished, [this, reply, id, type]() { QueryFinished(reply, id, type); });
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, id, type]() { QueryFinished(reply, id, type); });
return true;

View File

@@ -106,7 +106,7 @@ void MusicbrainzCoverProvider::SendSearchRequest(const SearchRequest &request) {
#endif
QNetworkReply *reply = network_->get(req);
replies_ << reply;
QObject::connect(reply, &QNetworkReply::finished, [this, reply, request]() { HandleSearchReply(reply, request.id); });
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, request]() { HandleSearchReply(reply, request.id); });
}

View File

@@ -88,7 +88,7 @@ bool MusixmatchCoverProvider::StartSearch(const QString &artist, const QString &
#endif
QNetworkReply *reply = network_->get(req);
replies_ << reply;
QObject::connect(reply, &QNetworkReply::finished, [this, reply, id, artist, album]() { HandleSearchReply(reply, id, artist, album); });
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, id, artist, album]() { HandleSearchReply(reply, id, artist, album); });
//qLog(Debug) << "Musixmatch: Sending request for" << artist_stripped << album_stripped << url;

View File

@@ -111,7 +111,7 @@ bool QobuzCoverProvider::StartSearch(const QString &artist, const QString &album
req.setRawHeader("X-User-Auth-Token", user_auth_token_.toUtf8());
QNetworkReply *reply = network_->get(req);
replies_ << reply;
QObject::connect(reply, &QNetworkReply::finished, [this, reply, id]() { HandleSearchReply(reply, id); });
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, id]() { HandleSearchReply(reply, id); });
return true;

View File

@@ -247,7 +247,7 @@ void SpotifyCoverProvider::RequestAccessToken(const QString code, const QUrl red
QNetworkReply *reply = network_->post(req, query);
replies_ << reply;
QObject::connect(reply, &QNetworkReply::sslErrors, this, &SpotifyCoverProvider::HandleLoginSSLErrors);
QObject::connect(reply, &QNetworkReply::finished, [this, reply]() { AccessTokenRequestFinished(reply); });
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply]() { AccessTokenRequestFinished(reply); });
}
@@ -402,7 +402,7 @@ bool SpotifyCoverProvider::StartSearch(const QString &artist, const QString &alb
QNetworkReply *reply = network_->get(req);
replies_ << reply;
QObject::connect(reply, &QNetworkReply::finished, [this, reply, id, extract]() { HandleSearchReply(reply, id, extract); });
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, id, extract]() { HandleSearchReply(reply, id, extract); });
return true;

View File

@@ -117,7 +117,7 @@ bool TidalCoverProvider::StartSearch(const QString &artist, const QString &album
QNetworkReply *reply = network_->get(req);
replies_ << reply;
QObject::connect(reply, &QNetworkReply::finished, [this, reply, id]() { HandleSearchReply(reply, id); });
QObject::connect(reply, &QNetworkReply::finished, this, [this, reply, id]() { HandleSearchReply(reply, id); });
return true;