Navigation Menu

Skip to content

Commit

Permalink
Use QNetworkReply::errorOccurred on Qt 5.15+
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 30, 2021
1 parent f0aafd2 commit 405ae2d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/auth/oauth2/qgsauthoauth2edit.cpp
Expand Up @@ -1145,7 +1145,11 @@ void QgsAuthOAuth2Edit::registerSoftStatement( const QString &registrationUrl )
registerReply = QgsNetworkAccessManager::instance()->post( registerRequest, json );
mDownloading = true;
connect( registerReply, &QNetworkReply::finished, this, &QgsAuthOAuth2Edit::registerReplyFinished, Qt::QueuedConnection );
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect( registerReply, qOverload<QNetworkReply::NetworkError>( &QNetworkReply::error ), this, &QgsAuthOAuth2Edit::networkError, Qt::QueuedConnection );
#else
connect( registerReply, &QNetworkReply::errorOccurred, this, &QgsAuthOAuth2Edit::networkError, Qt::QueuedConnection );
#endif
}

void QgsAuthOAuth2Edit::getSoftwareStatementConfig()
Expand All @@ -1163,7 +1167,11 @@ void QgsAuthOAuth2Edit::getSoftwareStatementConfig()
QNetworkReply *configReply = QgsNetworkAccessManager::instance()->get( configRequest );
mDownloading = true;
connect( configReply, &QNetworkReply::finished, this, &QgsAuthOAuth2Edit::configReplyFinished, Qt::QueuedConnection );
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect( configReply, qOverload<QNetworkReply::NetworkError>( &QNetworkReply::error ), this, &QgsAuthOAuth2Edit::networkError, Qt::QueuedConnection );
#else
connect( configReply, &QNetworkReply::errorOccurred, this, &QgsAuthOAuth2Edit::networkError, Qt::QueuedConnection );
#endif
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/auth/oauth2/qgso2.cpp
Expand Up @@ -312,7 +312,11 @@ void QgsO2::onVerificationReceived( QMap<QString, QString> response )
QNetworkReply *tokenReply = getManager()->post( tokenRequest, data );
timedReplies_.add( tokenReply );
connect( tokenReply, &QNetworkReply::finished, this, &QgsO2::onTokenReplyFinished, Qt::QueuedConnection );
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect( tokenReply, qOverload<QNetworkReply::NetworkError>( &QNetworkReply::error ), this, &QgsO2::onTokenReplyError, Qt::QueuedConnection );
#else
connect( tokenReply, &QNetworkReply::errorOccurred, this, &QgsO2::onTokenReplyError, Qt::QueuedConnection );
#endif
}
else if ( grantFlow_ == GrantFlowImplicit )
{
Expand Down
6 changes: 6 additions & 0 deletions src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -4603,7 +4603,13 @@ void QgsWmsLegendDownloadHandler::startUrl( const QUrl &url )

mReply = mNetworkAccessManager.get( request );
mSettings.authorization().setAuthorizationReply( mReply );

#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
connect( mReply, static_cast < void ( QNetworkReply::* )( QNetworkReply::NetworkError ) >( &QNetworkReply::error ), this, &QgsWmsLegendDownloadHandler::errored );
#else
connect( mReply, &QNetworkReply::errorOccurred, this, &QgsWmsLegendDownloadHandler::errored );
#endif

connect( mReply, &QNetworkReply::finished, this, &QgsWmsLegendDownloadHandler::finished );
connect( mReply, &QNetworkReply::downloadProgress, this, &QgsWmsLegendDownloadHandler::progressed );
}
Expand Down

0 comments on commit 405ae2d

Please sign in to comment.