Qt6: update the connect calls for QNetworkReply

Because of the old connect syntax used the incorrect signal names weren't
caught at compile time. To switch to the new syntax we had to make two
functions pure virtual in the WebServices class - let's hope I got that right.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2022-04-10 18:49:11 -10:00
parent e9b4d02d24
commit c41e2489a4
5 changed files with 34 additions and 4 deletions

View file

@ -45,13 +45,19 @@ void uploadDiveShare::doUpload(bool selected, const QString &uid, bool noPublic)
reply = manager()->put(request, json_data);
// connect signals from upload process
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
connect(reply, &QNetworkReply::finished, this, &uploadDiveShare::uploadFinishedSlot);
connect(reply, &QNetworkReply::errorOccurred, this, &uploadDiveShare::uploadErrorSlot);
connect(reply, &QNetworkReply::uploadProgress, this, &uploadDiveShare::updateProgressSlot);
connect(&timeout, &QTimer::timeout, this, &uploadDiveShare::uploadTimeoutSlot);
#else
connect(reply, SIGNAL(finished()), this, SLOT(uploadFinishedSlot()));
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this,
SLOT(uploadErrorSlot(QNetworkReply::NetworkError)));
connect(reply, SIGNAL(uploadProgress(qint64, qint64)), this,
SLOT(updateProgressSlot(qint64, qint64)));
connect(&timeout, SIGNAL(timeout()), this, SLOT(uploadTimeoutSlot()));
#endif
timeout.start(30000); // 30s
}