Skip to content
Permalink
Browse files
[auth] Update OAuth2 plugin to new QgsApplication::authManager()
  • Loading branch information
dakcarto authored and elpaso committed Jun 25, 2018
1 parent cdafca5 commit 4ee0249
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
@@ -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;
@@ -18,6 +18,7 @@
#include <QDir>
#include <QFileDialog>

#include "qgsapplication.h"
#include "qgsauthguiutils.h"
#include "qgsauthmanager.h"
#include "qgsauthconfigedit.h"
@@ -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() );

@@ -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();
@@ -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()
{
@@ -30,7 +30,8 @@
#include "qgsauthoauth2config.h"


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

0 comments on commit 4ee0249

Please sign in to comment.