Replace closures with new Qt functor variant of connect.

This commit is contained in:
Jim Broadus 2020-02-14 00:56:18 -08:00 committed by John Maguire
parent 58e59adcfc
commit a0bb8ab3a1
1 changed files with 9 additions and 9 deletions

View File

@ -118,8 +118,8 @@ void DropboxService::RequestFileList() {
QJsonDocument document(json);
QNetworkReply* reply = network_->post(request, document.toJson());
NewClosure(reply, SIGNAL(finished()), this,
SLOT(RequestFileListFinished(QNetworkReply*)), reply);
connect(reply, &QNetworkReply::finished,
[=] { this->RequestFileListFinished(reply); });
} else {
QUrl url = QUrl(kListFolderContinueEndpoint);
QJsonObject json;
@ -129,8 +129,8 @@ void DropboxService::RequestFileList() {
request.setRawHeader("Authorization", GenerateAuthorisationHeader());
request.setRawHeader("Content-Type", "application/json; charset=utf-8");
QNetworkReply* reply = network_->post(request, document.toJson());
NewClosure(reply, SIGNAL(finished()), this,
SLOT(RequestFileListFinished(QNetworkReply*)), reply);
connect(reply, &QNetworkReply::finished,
[=] { this->RequestFileListFinished(reply); });
}
}
@ -176,9 +176,9 @@ void DropboxService::RequestFileListFinished(QNetworkReply* reply) {
if (ShouldIndexFile(url, GuessMimeTypeForFile(url.toString()))) {
QNetworkReply* reply = FetchContentUrl(url);
NewClosure(reply, SIGNAL(finished()), this,
SLOT(FetchContentUrlFinished(QNetworkReply*, QVariantMap)),
reply, item.toVariantMap());
connect(reply, &QNetworkReply::finished, [=] {
this->FetchContentUrlFinished(reply, item.toVariantMap());
});
}
}
@ -209,8 +209,8 @@ void DropboxService::LongPollDelta() {
request.setRawHeader("Content-Type", "application/json; charset=utf-8");
QJsonDocument document(json);
QNetworkReply* reply = network_->post(request, document.toJson());
NewClosure(reply, SIGNAL(finished()), this,
SLOT(LongPollFinished(QNetworkReply*)), reply);
connect(reply, &QNetworkReply::finished,
[=] { this->LongPollFinished(reply); });
}
void DropboxService::LongPollFinished(QNetworkReply* reply) {