Skip to content
Permalink
Browse files

qgso2.cpp: fix false-positive warning about potentially unused variable

  • Loading branch information
rouault authored and nyalldawson committed Jun 15, 2020
1 parent c77ba5e commit e2eabe49f9c68522a79bb6ed1f40c9ec164f94c1
Showing with 3 additions and 5 deletions.
  1. +3 −5 src/auth/oauth2/qgso2.cpp
@@ -81,32 +81,30 @@ void QgsO2::initOAuthConfig()
setApiKey( mOAuth2Config->apiKey() );
setExtraRequestParams( mOAuth2Config->queryPairs() );

O2::GrantFlow o2flow;
switch ( mOAuth2Config->grantFlow() )
{
case QgsAuthOAuth2Config::AuthCode:
o2flow = O2::GrantFlowAuthorizationCode;
setGrantFlow( O2::GrantFlowAuthorizationCode );
setRequestUrl( mOAuth2Config->requestUrl() );
setClientId( mOAuth2Config->clientId() );
setClientSecret( mOAuth2Config->clientSecret() );

break;
case QgsAuthOAuth2Config::Implicit:
o2flow = O2::GrantFlowImplicit;
setGrantFlow( O2::GrantFlowImplicit );
setRequestUrl( mOAuth2Config->requestUrl() );
setClientId( mOAuth2Config->clientId() );

break;
case QgsAuthOAuth2Config::ResourceOwner:
o2flow = O2::GrantFlowResourceOwnerPasswordCredentials;
setGrantFlow( O2::GrantFlowResourceOwnerPasswordCredentials );
setClientId( mOAuth2Config->clientId() );
setClientSecret( mOAuth2Config->clientSecret() );
setUsername( mOAuth2Config->username() );
setPassword( mOAuth2Config->password() );

break;
}
setGrantFlow( o2flow );

setSettingsStore( mOAuth2Config->persistToken() );

0 comments on commit e2eabe4

Please sign in to comment.
You can’t perform that action at this time.