Skip to content

Commit

Permalink
[auth] Update OAuth2 plugin to new QgsApplication::authManager()
Browse files Browse the repository at this point in the history
  • Loading branch information
dakcarto committed Oct 27, 2017
1 parent 6354563 commit 6a4e397
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/auth/oauth2/qgsauthoauth2config.cpp
Expand Up @@ -676,7 +676,7 @@ QgsStringMap QgsAuthOAuth2Config::mapOAuth2Configs(
return configs;
}

QgsStringMap QgsAuthOAuth2Config::mappedOAuth2ConfigsCache(QObject *parent, const QString &extradir )
QgsStringMap QgsAuthOAuth2Config::mappedOAuth2ConfigsCache( QObject *parent, const QString &extradir )
{
QgsStringMap configs;
bool ok = false;
Expand Down
3 changes: 2 additions & 1 deletion src/auth/oauth2/qgsauthoauth2edit.cpp
Expand Up @@ -18,6 +18,7 @@
#include <QDir>
#include <QFileDialog>

#include "qgsapplication.h"
#include "qgsauthguiutils.h"
#include "qgsauthmanager.h"
#include "qgsauthconfigedit.h"
Expand Down Expand Up @@ -752,7 +753,7 @@ void QgsAuthOAuth2Edit::exportOAuthConfig()
settings.setValue( QStringLiteral( "UI/lastAuthSaveFileDir" ), QFileInfo( configpath ).absoluteDir().path() );

// give it a kind of random id for re-importing
mOAuthConfigCustom->setId( QgsAuthManager::instance()->uniqueConfigId() );
mOAuthConfigCustom->setId( QgsApplication::authManager()->uniqueConfigId() );

mOAuthConfigCustom->setQueryPairs( queryPairs() );

Expand Down
5 changes: 3 additions & 2 deletions src/auth/oauth2/qgsauthoauth2method.cpp
Expand Up @@ -499,7 +499,7 @@ QgsO2 *QgsAuthOAuth2Method::getOAuth2Bundle( const QString &authcfg, bool fullco

// else build oauth2 config
QgsAuthMethodConfig mconfig;
if ( !QgsAuthManager::instance()->loadAuthenticationConfig( authcfg, mconfig, fullconfig ) )
if ( !QgsApplication::authManager()->loadAuthenticationConfig( authcfg, mconfig, fullconfig ) )
{
QgsDebugMsg( QStringLiteral( "Retrieve config FAILED for authcfg: %1" ).arg( authcfg ) );
config->deleteLater();
Expand Down Expand Up @@ -637,7 +637,8 @@ QGISEXTERN QgsAuthOAuth2Method *classFactory()
return new QgsAuthOAuth2Method();
}

/** Required key function (used to map the plugin to a data store type)
/**
* Required key function (used to map the plugin to a data store type)
*/
QGISEXTERN QString authMethodKey()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/src/auth/testqgsauthoauth2method.cpp
Expand Up @@ -30,7 +30,8 @@
#include "qgsauthoauth2config.h"


/** \ingroup UnitTests
/**
* \ingroup UnitTests
* Unit tests for QgsAuthOAuth2Config
*/
class TestQgsAuthOAuth2Method: public QObject
Expand Down

0 comments on commit 6a4e397

Please sign in to comment.