From 68dfbb1808e4a8d58e2ead6e83d95d7145638a8d Mon Sep 17 00:00:00 2001 From: Damiano Lombardi Date: Wed, 11 Dec 2024 14:01:24 +0100 Subject: [PATCH] fix indentation --- src/core/auth/qgsauthorizationsettings.cpp | 44 +++++++++++----------- src/core/auth/qgsauthorizationsettings.h | 30 +++++++-------- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/core/auth/qgsauthorizationsettings.cpp b/src/core/auth/qgsauthorizationsettings.cpp index e694f91a84eb..2e20204642fb 100644 --- a/src/core/auth/qgsauthorizationsettings.cpp +++ b/src/core/auth/qgsauthorizationsettings.cpp @@ -15,34 +15,34 @@ #include "qgsauthorizationsettings.h" -QgsAuthorizationSettings::QgsAuthorizationSettings(const QString &userName, const QString &password, const QgsHttpHeaders &httpHeaders, const QString &authcfg) - : mUserName( userName ) - , mPassword( password ) - , mHttpHeaders( httpHeaders ) - , mAuthCfg( authcfg ) +QgsAuthorizationSettings::QgsAuthorizationSettings( const QString &userName, const QString &password, const QgsHttpHeaders &httpHeaders, const QString &authcfg ) + : mUserName( userName ) + , mPassword( password ) + , mHttpHeaders( httpHeaders ) + , mAuthCfg( authcfg ) {} -bool QgsAuthorizationSettings::setAuthorization(QNetworkRequest &request) const +bool QgsAuthorizationSettings::setAuthorization( QNetworkRequest &request ) const { - if ( !mAuthCfg.isEmpty() ) // must be non-empty value - { - return QgsApplication::authManager()->updateNetworkRequest( request, mAuthCfg ); - } - else if ( !mUserName.isEmpty() || !mPassword.isEmpty() ) - { - request.setRawHeader( "Authorization", "Basic " + QStringLiteral( "%1:%2" ).arg( mUserName, mPassword ).toUtf8().toBase64() ); - } + if ( !mAuthCfg.isEmpty() ) // must be non-empty value + { + return QgsApplication::authManager()->updateNetworkRequest( request, mAuthCfg ); + } + else if ( !mUserName.isEmpty() || !mPassword.isEmpty() ) + { + request.setRawHeader( "Authorization", "Basic " + QStringLiteral( "%1:%2" ).arg( mUserName, mPassword ).toUtf8().toBase64() ); + } - mHttpHeaders.updateNetworkRequest( request ); + mHttpHeaders.updateNetworkRequest( request ); - return true; + return true; } -bool QgsAuthorizationSettings::setAuthorizationReply(QNetworkReply *reply) const +bool QgsAuthorizationSettings::setAuthorizationReply( QNetworkReply *reply ) const { - if ( !mAuthCfg.isEmpty() ) - { - return QgsApplication::authManager()->updateNetworkReply( reply, mAuthCfg ); - } - return true; + if ( !mAuthCfg.isEmpty() ) + { + return QgsApplication::authManager()->updateNetworkReply( reply, mAuthCfg ); + } + return true; } diff --git a/src/core/auth/qgsauthorizationsettings.h b/src/core/auth/qgsauthorizationsettings.h index c84d5c923d83..671ba53e5398 100644 --- a/src/core/auth/qgsauthorizationsettings.h +++ b/src/core/auth/qgsauthorizationsettings.h @@ -35,27 +35,27 @@ class CORE_EXPORT QgsAuthorizationSettings { public: - - //! Constructor for QgsAuthorizationSettings. - QgsAuthorizationSettings( const QString &userName = QString(), const QString &password = QString(), const QgsHttpHeaders &httpHeaders = QgsHttpHeaders(), const QString &authcfg = QString() ); - //! Update authorization for request - bool setAuthorization( QNetworkRequest &request ) const; + //! Constructor for QgsAuthorizationSettings. + QgsAuthorizationSettings( const QString &userName = QString(), const QString &password = QString(), const QgsHttpHeaders &httpHeaders = QgsHttpHeaders(), const QString &authcfg = QString() ); - //! Update authorization for reply - bool setAuthorizationReply( QNetworkReply *reply ) const; + //! Update authorization for request + bool setAuthorization( QNetworkRequest &request ) const; - //! Username for basic http authentication - QString mUserName; + //! Update authorization for reply + bool setAuthorizationReply( QNetworkReply *reply ) const; - //! Password for basic http authentication - QString mPassword; + //! Username for basic http authentication + QString mUserName; - //! headers for http requests - QgsHttpHeaders mHttpHeaders; + //! Password for basic http authentication + QString mPassword; - //! Authentication configuration ID - QString mAuthCfg; + //! headers for http requests + QgsHttpHeaders mHttpHeaders; + + //! Authentication configuration ID + QString mAuthCfg; }; #endif // QGSAUTHORIZATIONSETTINGS_H