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_); reply_ = manager_->get(request_);
connect(reply_, &QNetworkReply::finished, this, &FoxVerifier::httpFinished); connect(reply_, &QNetworkReply::finished, this, &FoxVerifier::httpFinished);
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(reply_, &QNetworkReply::errorOccurred, this, &FoxVerifier::errorOccurred); connect(reply_, &QNetworkReply::errorOccurred, this, &FoxVerifier::errorOccurred);
#endif
connect(reply_, &QNetworkReply::redirected, this, &FoxVerifier::httpRedirected); connect(reply_, &QNetworkReply::redirected, this, &FoxVerifier::httpRedirected);
connect(reply_, &QNetworkReply::encrypted, this, &FoxVerifier::httpEncrypted); connect(reply_, &QNetworkReply::encrypted, this, &FoxVerifier::httpEncrypted);
#if QT_CONFIG(ssl) #if QT_CONFIG(ssl)
@ -52,7 +54,7 @@ bool FoxVerifier::finished() {
return finished_; return finished_;
} }
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
void FoxVerifier::errorOccurred(QNetworkReply::NetworkError code) void FoxVerifier::errorOccurred(QNetworkReply::NetworkError code)
{ {
int status = reply_->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); int status = reply_->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
@ -65,6 +67,7 @@ void FoxVerifier::errorOccurred(QNetworkReply::NetworkError code)
} }
// TODO emit // TODO emit
} }
#endif
void FoxVerifier::httpFinished() void FoxVerifier::httpFinished()
{ {

View File

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