Skip to content
Permalink
Browse files

Use QNetworkReply::errorOccurred on Qt 5.15+

  • Loading branch information
nyalldawson committed Mar 30, 2021
1 parent f0aafd2 commit 405ae2dd8e0ca0cc6ce898f5e64515605043e3c3
Showing with 18 additions and 0 deletions.
  1. +8 −0 src/auth/oauth2/qgsauthoauth2edit.cpp
  2. +4 −0 src/auth/oauth2/qgso2.cpp
  3. +6 −0 src/providers/wms/qgswmsprovider.cpp
@@ -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()
@@ -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
}
}

@@ -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 )
{
@@ -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 );
}

0 comments on commit 405ae2d

Please sign in to comment.