Workaround for a compilation error with Qt 5.12.

This commit is contained in:
Uwe Risse 2024-09-08 14:02:57 +02:00
parent 521a0e1a0d
commit 223d9f5d63
2 changed files with 5 additions and 4 deletions

View File

@ -31,7 +31,9 @@ FoxVerifier::FoxVerifier(QString user_agent, QNetworkAccessManager *manager,QStr
reply_ = manager_->get(request_);
connect(reply_, &QNetworkReply::finished, this, &FoxVerifier::httpFinished);
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(reply_, &QNetworkReply::errorOccurred, this, &FoxVerifier::errorOccurred);
#endif
connect(reply_, &QNetworkReply::redirected, this, &FoxVerifier::httpRedirected);
connect(reply_, &QNetworkReply::encrypted, this, &FoxVerifier::httpEncrypted);
#if QT_CONFIG(ssl)
@ -52,7 +54,7 @@ bool FoxVerifier::finished() {
return finished_;
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
void FoxVerifier::errorOccurred(QNetworkReply::NetworkError code)
{
int status = reply_->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
@ -65,6 +67,7 @@ void FoxVerifier::errorOccurred(QNetworkReply::NetworkError code)
}
// TODO emit
}
#endif
void FoxVerifier::httpFinished()
{
@ -115,4 +118,4 @@ QString FoxVerifier::formatDecodeMessage(QDateTime ts, QString callsign, unsigne
QString FoxVerifier::default_url() {
return QString(FOXVERIFIER_DEFAULT_BASE_URL);
}
}

View File

@ -47,8 +47,6 @@ private slots:
#endif
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
void errorOccurred(QNetworkReply::NetworkError code);
#else
void obsoleteError();
#endif
//signals:
//void results(QString verify_response);