refactor: Modernize Qt connections (#914)

This commit is contained in:
Murat Seker
2020-08-02 22:32:00 +02:00
committed by GitHub
parent d1a2b77ce3
commit 031b9a6b7c
22 changed files with 86 additions and 77 deletions

View File

@@ -128,7 +128,7 @@ httpResponse ProviderRestApi::get(const QUrl &url)
QNetworkReply* reply = _networkManager->get(request);
// Connect requestFinished signal to quit slot of the loop.
QEventLoop loop;
loop.connect(reply, SIGNAL(finished()), SLOT(quit()));
loop.connect(reply, &QNetworkReply::finished, &loop, &QEventLoop::quit);
// Go into the loop until the request is finished.
loop.exec();
@@ -156,7 +156,7 @@ httpResponse ProviderRestApi::put(const QUrl &url, const QString &body)
QNetworkReply* reply = _networkManager->put(request, body.toUtf8());
// Connect requestFinished signal to quit slot of the loop.
QEventLoop loop;
loop.connect(reply, SIGNAL(finished()), SLOT(quit()));
loop.connect(reply, &QNetworkReply::finished, &loop, &QEventLoop::quit);
// Go into the loop until the request is finished.
loop.exec();