diff --git a/CMakeLists.txt b/CMakeLists.txt index 468e5cc517f9..18e38d956bcd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,6 +138,11 @@ if(WITH_CORE) set (WITH_GUI TRUE CACHE BOOL "Determines whether QGIS GUI library (and everything built on top of it) should be built") + set (WITH_OAUTH2_PLUGIN TRUE CACHE BOOL "Build OAuth2 authentication method plugin") + if(WITH_OAUTH2_PLUGIN) + set(HAVE_OAUTH2_PLUGIN TRUE) + endif() + set (WITH_AUTH TRUE CACHE BOOL "Determines whether QGIS authentication methods should be built") set (WITH_ANALYSIS TRUE CACHE BOOL "Determines whether QGIS analysis library should be built") diff --git a/cmake_templates/qgsconfig.h.in b/cmake_templates/qgsconfig.h.in index b5e01a5808dc..479134c28872 100644 --- a/cmake_templates/qgsconfig.h.in +++ b/cmake_templates/qgsconfig.h.in @@ -69,6 +69,8 @@ #cmakedefine HAVE_SERVER_PYTHON_PLUGINS +#cmakedefine HAVE_OAUTH2_PLUGIN + #cmakedefine HAVE_OPENCL #cmakedefine OPENCL_USE_NEW_HEADER diff --git a/src/auth/CMakeLists.txt b/src/auth/CMakeLists.txt index 2bf2b9dd46a4..293158ab09d4 100644 --- a/src/auth/CMakeLists.txt +++ b/src/auth/CMakeLists.txt @@ -18,7 +18,6 @@ add_subdirectory(identcert) add_subdirectory(pkipaths) add_subdirectory(pkipkcs12) -set(WITH_OAUTH2_PLUGIN TRUE CACHE BOOL "Build OAuth2 authentication method plugin") if (WITH_OAUTH2_PLUGIN) add_subdirectory(oauth2) endif() diff --git a/src/auth/basic/CMakeLists.txt b/src/auth/basic/CMakeLists.txt index 020467e3fcaa..e700711d6a11 100644 --- a/src/auth/basic/CMakeLists.txt +++ b/src/auth/basic/CMakeLists.txt @@ -10,7 +10,6 @@ set(AUTH_BASIC_UIS_H "") if (WITH_GUI) set(AUTH_BASIC_SRCS ${AUTH_BASIC_SRCS} - gui/qgsauthbasicmethodgui.cpp gui/qgsauthbasicedit.cpp ) set(AUTH_BASIC_HDRS ${AUTH_BASIC_HDRS} @@ -20,28 +19,51 @@ if (WITH_GUI) QT5_WRAP_UI(AUTH_BASIC_UIS_H ${AUTH_BASIC_UIS}) endif() -add_library(authmethod_basic MODULE ${AUTH_BASIC_SRCS} ${AUTH_BASIC_HDRS} ${AUTH_BASIC_UIS_H}) -target_include_directories(authmethod_basic PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/core -) +# static library +add_library(authmethod_basic_a STATIC ${AUTH_BASIC_SRCS} ${AUTH_BASIC_HDRS} ${AUTH_BASIC_UIS_H}) + +target_include_directories(authmethod_basic_a PUBLIC ${CMAKE_SOURCE_DIR}/src/auth/basic/core) # require c++17 -target_compile_features(authmethod_basic PRIVATE cxx_std_17) +target_compile_features(authmethod_basic_a PRIVATE cxx_std_17) -target_link_libraries(authmethod_basic qgis_core) +target_link_libraries(authmethod_basic_a qgis_core) if (WITH_GUI) - target_include_directories(authmethod_basic PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/gui - ${CMAKE_CURRENT_BINARY_DIR} + target_include_directories(authmethod_basic_a PRIVATE + ${CMAKE_SOURCE_DIR}/src/auth/basic/gui + ${CMAKE_BINARY_DIR}/src/auth/basic ) - target_link_libraries(authmethod_basic qgis_gui) + + target_link_libraries (authmethod_basic_a qgis_gui) endif() -target_compile_definitions(authmethod_basic PRIVATE "-DQT_NO_FOREACH") +target_compile_definitions(authmethod_basic_a PRIVATE "-DQT_NO_FOREACH") -install(TARGETS authmethod_basic - RUNTIME DESTINATION ${QGIS_PLUGIN_DIR} - LIBRARY DESTINATION ${QGIS_PLUGIN_DIR} -) + + +if (FORCE_STATIC_LIBS) + # for (external) mobile apps to be able to pick up provider for linking + install (TARGETS authmethod_basic_a ARCHIVE DESTINATION ${QGIS_PLUGIN_DIR}) +else() + # dynamically loaded module + add_library(authmethod_basic MODULE ${AUTH_BASIC_SRCS} ${AUTH_BASIC_HDRS} ${AUTH_BASIC_UIS_H}) + + # require c++17 + target_compile_features(authmethod_basic PRIVATE cxx_std_17) + + target_link_libraries(authmethod_basic qgis_core) + + if (WITH_GUI) + target_link_libraries (authmethod_basic qgis_gui) + add_dependencies(authmethod_basic ui) + endif() + + target_compile_definitions(authmethod_basic PRIVATE "-DQT_NO_FOREACH") + + install (TARGETS authmethod_basic + RUNTIME DESTINATION ${QGIS_PLUGIN_DIR} + LIBRARY DESTINATION ${QGIS_PLUGIN_DIR} + ) +endif() diff --git a/src/auth/basic/core/qgsauthbasicmethod.cpp b/src/auth/basic/core/qgsauthbasicmethod.cpp index 6b32a96ec35c..282e0459221b 100644 --- a/src/auth/basic/core/qgsauthbasicmethod.cpp +++ b/src/auth/basic/core/qgsauthbasicmethod.cpp @@ -20,12 +20,16 @@ #include "qgslogger.h" #include "qgsapplication.h" +#ifdef HAVE_GUI +#include "qgsauthbasicedit.h" +#endif + #include #include #include -static const QString AUTH_METHOD_KEY = QStringLiteral( "Basic" ); -static const QString AUTH_METHOD_DESCRIPTION = QStringLiteral( "Basic authentication" ); +const QString QgsAuthBasicMethod::AUTH_METHOD_KEY = QStringLiteral( "Basic" ); +const QString QgsAuthBasicMethod::AUTH_METHOD_DESCRIPTION = tr( "Basic authentication" ); QMap QgsAuthBasicMethod::sAuthConfigCache = QMap(); @@ -48,20 +52,16 @@ QgsAuthBasicMethod::QgsAuthBasicMethod() } -QString QgsAuthBasicMethod::key() const +QString QgsAuthBasicMethod::key() { return AUTH_METHOD_KEY; } -QString QgsAuthBasicMethod::description() const +QString QgsAuthBasicMethod::description() { return AUTH_METHOD_DESCRIPTION; } -QString QgsAuthBasicMethod::displayDescription() const -{ - return tr( "Basic authentication" ); -} bool QgsAuthBasicMethod::updateNetworkRequest( QNetworkRequest &request, const QString &authcfg, const QString &dataprovider ) @@ -313,6 +313,13 @@ void QgsAuthBasicMethod::updateMethodConfig( QgsAuthMethodConfig &mconfig ) // TODO: add updates as method version() increases due to config storage changes } +#ifdef HAVE_GUI +QWidget *QgsAuthBasicMethod::editWidget( QWidget *parent ) const +{ + return new QgsAuthBasicEdit( parent ); +} +#endif + void QgsAuthBasicMethod::clearCachedConfig( const QString &authcfg ) { removeMethodConfig( authcfg ); @@ -375,42 +382,13 @@ QString QgsAuthBasicMethod::escapeUserPass( const QString &val, QChar delim ) co // Plugin externals ////////////////////////////////////////////// -/** - * Required class factory to return a pointer to a newly created object - */ -QGISEXTERN QgsAuthBasicMethod *classFactory() -{ - return new QgsAuthBasicMethod(); -} -/** - * Required key function (used to map the plugin to a data store type) - */ -QGISEXTERN QString authMethodKey() +#ifndef HAVE_STATIC_PROVIDERS +QGISEXTERN QgsAuthMethodMetadata *authMethodMetadataFactory() { - return AUTH_METHOD_KEY; + return new QgsAuthBasicMethodMetadata(); } +#endif -/** - * Required description function - */ -QGISEXTERN QString description() -{ - return AUTH_METHOD_DESCRIPTION; -} -/** - * Required isAuthMethod function. Used to determine if this shared library - * is an authentication method plugin - */ -QGISEXTERN bool isAuthMethod() -{ - return true; -} -/** - * Required cleanup function - */ -QGISEXTERN void cleanupAuthMethod() // pass QgsAuthMethod *method, then delete method ? -{ -} diff --git a/src/auth/basic/core/qgsauthbasicmethod.h b/src/auth/basic/core/qgsauthbasicmethod.h index 2d27caf3ff79..b516ad09326b 100644 --- a/src/auth/basic/core/qgsauthbasicmethod.h +++ b/src/auth/basic/core/qgsauthbasicmethod.h @@ -22,21 +22,25 @@ #include "qgsauthconfig.h" #include "qgsauthmethod.h" +#include "qgsauthmethodmetadata.h" +class QWidget; class QgsAuthBasicMethod : public QgsAuthMethod { Q_OBJECT public: + + static const QString AUTH_METHOD_KEY; + static const QString AUTH_METHOD_DESCRIPTION; + explicit QgsAuthBasicMethod(); // QgsAuthMethod interface - QString key() const override; - - QString description() const override; + static QString key(); - QString displayDescription() const override; + static QString description(); bool updateNetworkRequest( QNetworkRequest &request, const QString &authcfg, const QString &dataprovider = QString() ) override; @@ -52,6 +56,10 @@ class QgsAuthBasicMethod : public QgsAuthMethod void updateMethodConfig( QgsAuthMethodConfig &mconfig ) override; +#ifdef HAVE_GUI + QWidget *editWidget( QWidget *parent )const override; +#endif + private: QgsAuthMethodConfig getMethodConfig( const QString &authcfg, bool fullconfig = true ); @@ -62,7 +70,19 @@ class QgsAuthBasicMethod : public QgsAuthMethod QString escapeUserPass( const QString &val, QChar delim = '\'' ) const; static QMap sAuthConfigCache; +}; +class QgsAuthBasicMethodMetadata : public QgsAuthMethodMetadata +{ + public: + QgsAuthBasicMethodMetadata() + : QgsAuthMethodMetadata( QgsAuthBasicMethod::AUTH_METHOD_KEY, QgsAuthBasicMethod::AUTH_METHOD_DESCRIPTION ) + {} + QgsAuthBasicMethod *createAuthMethod() const override {return new QgsAuthBasicMethod;} + //QStringList supportedDataProviders() const override; }; + + + #endif // QGSAUTHBASICMETHOD_H diff --git a/src/auth/basic/gui/qgsauthbasicmethodgui.cpp b/src/auth/basic/gui/qgsauthbasicmethodgui.cpp deleted file mode 100644 index c16c2d4e184e..000000000000 --- a/src/auth/basic/gui/qgsauthbasicmethodgui.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/*************************************************************************** - qgsauthbasicmethodgui.cpp - --------------------- - begin : September 1, 2015 - copyright : (C) 2015 by Boundless Spatial, Inc. USA - author : Larry Shaffer - email : lshaffer at boundlessgeo dot com - *************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "qgsauthbasicedit.h" - -/** - * Optional class factory to return a pointer to a newly created edit widget - */ -QGISEXTERN QgsAuthBasicEdit *editWidget( QWidget *parent ) -{ - return new QgsAuthBasicEdit( parent ); -} diff --git a/src/auth/esritoken/CMakeLists.txt b/src/auth/esritoken/CMakeLists.txt index 6af83ace32f8..26a68e2e60ce 100644 --- a/src/auth/esritoken/CMakeLists.txt +++ b/src/auth/esritoken/CMakeLists.txt @@ -10,7 +10,6 @@ set(AUTH_ESRITOKEN_UIS_H "") if (WITH_GUI) set(AUTH_ESRITOKEN_SRCS ${AUTH_ESRITOKEN_SRCS} - gui/qgsauthesritokenmethodgui.cpp gui/qgsauthesritokenedit.cpp ) set(AUTH_ESRITOKEN_HDRS ${AUTH_ESRITOKEN_HDRS} @@ -20,28 +19,49 @@ if (WITH_GUI) QT5_WRAP_UI(AUTH_ESRITOKEN_UIS_H ${AUTH_ESRITOKEN_UIS}) endif() -add_library(authmethod_esritoken MODULE ${AUTH_ESRITOKEN_SRCS} ${AUTH_ESRITOKEN_HDRS} ${AUTH_ESRITOKEN_UIS_H}) -target_include_directories(authmethod_esritoken PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/core -) +# static library +add_library(authmethod_esritoken_a STATIC ${AUTH_ESRITOKEN_SRCS} ${AUTH_ESRITOKEN_HDRS} ${AUTH_ESRITOKEN_UIS_H}) + +target_include_directories(authmethod_esritoken_a PUBLIC ${CMAKE_SOURCE_DIR}/src/auth/esritoken/core) # require c++17 -target_compile_features(authmethod_esritoken PRIVATE cxx_std_17) +target_compile_features(authmethod_esritoken_a PRIVATE cxx_std_17) -target_link_libraries(authmethod_esritoken qgis_core) +target_link_libraries(authmethod_esritoken_a qgis_core) if (WITH_GUI) - target_include_directories(authmethod_esritoken PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/gui - ${CMAKE_CURRENT_BINARY_DIR} + target_include_directories(authmethod_esritoken_a PRIVATE + ${CMAKE_SOURCE_DIR}/src/auth/esritoken/gui + ${CMAKE_BINARY_DIR}/src/auth/esritoken ) - target_link_libraries(authmethod_esritoken qgis_gui) + + target_link_libraries (authmethod_esritoken_a qgis_gui) endif() -target_compile_definitions(authmethod_esritoken PRIVATE "-DQT_NO_FOREACH") +target_compile_definitions(authmethod_esritoken_a PRIVATE "-DQT_NO_FOREACH") -install(TARGETS authmethod_esritoken - RUNTIME DESTINATION ${QGIS_PLUGIN_DIR} - LIBRARY DESTINATION ${QGIS_PLUGIN_DIR} -) +if (FORCE_STATIC_LIBS) + # for (external) mobile apps to be able to pick up provider for linking + install (TARGETS authmethod_esritoken_a ARCHIVE DESTINATION ${QGIS_PLUGIN_DIR}) +else() + # dynamically loaded module + add_library(authmethod_esritoken MODULE ${AUTH_ESRITOKEN_SRCS} ${AUTH_ESRITOKEN_HDRS} ${AUTH_ESRITOKEN_UIS_H}) + + # require c++17 + target_compile_features(authmethod_esritoken PRIVATE cxx_std_17) + + target_link_libraries(authmethod_esritoken qgis_core) + + if (WITH_GUI) + target_link_libraries (authmethod_esritoken qgis_gui) + add_dependencies(authmethod_esritoken ui) + endif() + + target_compile_definitions(authmethod_esritoken PRIVATE "-DQT_NO_FOREACH") + + install (TARGETS authmethod_esritoken + RUNTIME DESTINATION ${QGIS_PLUGIN_DIR} + LIBRARY DESTINATION ${QGIS_PLUGIN_DIR} + ) +endif() diff --git a/src/auth/esritoken/core/qgsauthesritokenmethod.cpp b/src/auth/esritoken/core/qgsauthesritokenmethod.cpp index 662330e6de4d..3d3ddabefd89 100644 --- a/src/auth/esritoken/core/qgsauthesritokenmethod.cpp +++ b/src/auth/esritoken/core/qgsauthesritokenmethod.cpp @@ -24,8 +24,8 @@ #include #include -static const QString AUTH_METHOD_KEY = QStringLiteral( "EsriToken" ); -static const QString AUTH_METHOD_DESCRIPTION = QStringLiteral( "ESRI token" ); +const QString QgsAuthEsriTokenMethod::AUTH_METHOD_KEY = QStringLiteral( "EsriToken" ); +const QString QgsAuthEsriTokenMethod::AUTH_METHOD_DESCRIPTION = tr( "ESRI token" ); QMap QgsAuthEsriTokenMethod::sAuthConfigCache = QMap(); @@ -40,21 +40,16 @@ QgsAuthEsriTokenMethod::QgsAuthEsriTokenMethod() } -QString QgsAuthEsriTokenMethod::key() const +QString QgsAuthEsriTokenMethod::key() { return AUTH_METHOD_KEY; } -QString QgsAuthEsriTokenMethod::description() const +QString QgsAuthEsriTokenMethod::description() { return AUTH_METHOD_DESCRIPTION; } -QString QgsAuthEsriTokenMethod::displayDescription() const -{ - return tr( "ESRI token based authentication" ); -} - bool QgsAuthEsriTokenMethod::updateNetworkRequest( QNetworkRequest &request, const QString &authcfg, const QString &dataprovider ) { diff --git a/src/auth/esritoken/core/qgsauthesritokenmethod.h b/src/auth/esritoken/core/qgsauthesritokenmethod.h index eb006df11e4d..552663436a5f 100644 --- a/src/auth/esritoken/core/qgsauthesritokenmethod.h +++ b/src/auth/esritoken/core/qgsauthesritokenmethod.h @@ -29,14 +29,16 @@ class QgsAuthEsriTokenMethod : public QgsAuthMethod Q_OBJECT public: + + static const QString AUTH_METHOD_KEY; + static const QString AUTH_METHOD_DESCRIPTION; + explicit QgsAuthEsriTokenMethod(); // QgsAuthMethod interface - QString key() const override; - - QString description() const override; + static QString key(); - QString displayDescription() const override; + static QString description(); bool updateNetworkRequest( QNetworkRequest &request, const QString &authcfg, const QString &dataprovider = QString() ) override; diff --git a/src/auth/esritoken/gui/qgsauthesritokenmethodgui.cpp b/src/auth/esritoken/gui/qgsauthesritokenmethodgui.cpp deleted file mode 100644 index 9655a411f61f..000000000000 --- a/src/auth/esritoken/gui/qgsauthesritokenmethodgui.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/*************************************************************************** - qgsauthesritokenmethodgui.cpp - -------------------------- - begin : October 2018 - copyright : (C) 2018 by Nyall Dawson - author : Nyall Dawson - email : nyall dot dawson at gmail dot com - *************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "qgsauthesritokenedit.h" - - -/** - * Optional class factory to return a pointer to a newly created edit widget - */ -QGISEXTERN QgsAuthEsriTokenEdit *editWidget( QWidget *parent ) -{ - return new QgsAuthEsriTokenEdit( parent ); -} - diff --git a/src/auth/identcert/CMakeLists.txt b/src/auth/identcert/CMakeLists.txt index 0edbaa183af1..a23ebeefea38 100644 --- a/src/auth/identcert/CMakeLists.txt +++ b/src/auth/identcert/CMakeLists.txt @@ -10,7 +10,6 @@ set(AUTH_IDENTCERT_UIS_H "") if (WITH_GUI) set(AUTH_IDENTCERT_SRCS ${AUTH_IDENTCERT_SRCS} - gui/qgsauthidentcertmethodgui.cpp gui/qgsauthidentcertedit.cpp ) set(AUTH_IDENTCERT_HDRS ${AUTH_IDENTCERT_HDRS} @@ -20,33 +19,51 @@ if (WITH_GUI) QT5_WRAP_UI(AUTH_IDENTCERT_UIS_H ${AUTH_IDENTCERT_UIS}) endif() -add_library(authmethod_identcert MODULE ${AUTH_IDENTCERT_SRCS} ${AUTH_IDENTCERT_HDRS} ${AUTH_IDENTCERT_UIS_H}) -target_include_directories(authmethod_identcert SYSTEM PUBLIC - ${QCA_INCLUDE_DIR} - ${QTKEYCHAIN_INCLUDE_DIR} -) +# static library +add_library(authmethod_identcert_a STATIC ${AUTH_IDENTCERT_SRCS} ${AUTH_IDENTCERT_HDRS} ${AUTH_IDENTCERT_UIS_H}) -target_include_directories(authmethod_identcert PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/core -) +target_include_directories(authmethod_identcert_a PUBLIC ${CMAKE_SOURCE_DIR}/src/auth/identcert/core) # require c++17 -target_compile_features(authmethod_identcert PRIVATE cxx_std_17) +target_compile_features(authmethod_identcert_a PRIVATE cxx_std_17) -target_link_libraries(authmethod_identcert qgis_core) +target_link_libraries(authmethod_identcert_a qgis_core) if (WITH_GUI) - target_include_directories(authmethod_identcert PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/gui - ${CMAKE_CURRENT_BINARY_DIR} + target_include_directories(authmethod_identcert_a PRIVATE + ${CMAKE_SOURCE_DIR}/src/auth/identcert/gui + ${CMAKE_BINARY_DIR}/src/auth/identcert ) - target_link_libraries(authmethod_identcert qgis_gui) + + target_link_libraries (authmethod_identcert_a qgis_gui) endif() -target_compile_definitions(authmethod_identcert PRIVATE "-DQT_NO_FOREACH") +target_compile_definitions(authmethod_identcert_a PRIVATE "-DQT_NO_FOREACH") -install(TARGETS authmethod_identcert - RUNTIME DESTINATION ${QGIS_PLUGIN_DIR} - LIBRARY DESTINATION ${QGIS_PLUGIN_DIR} -) + + +if (FORCE_STATIC_LIBS) + # for (external) mobile apps to be able to pick up provider for linking + install (TARGETS authmethod_identcert_a ARCHIVE DESTINATION ${QGIS_PLUGIN_DIR}) +else() + # dynamically loaded module + add_library(authmethod_identcert MODULE ${AUTH_IDENTCERT_SRCS} ${AUTH_IDENTCERT_HDRS} ${AUTH_IDENTCERT_UIS_H}) + + # require c++17 + target_compile_features(authmethod_identcert PRIVATE cxx_std_17) + + target_link_libraries(authmethod_identcert qgis_core) + + if (WITH_GUI) + target_link_libraries (authmethod_identcert qgis_gui) + add_dependencies(authmethod_identcert ui) + endif() + + target_compile_definitions(authmethod_identcert PRIVATE "-DQT_NO_FOREACH") + + install (TARGETS authmethod_identcert + RUNTIME DESTINATION ${QGIS_PLUGIN_DIR} + LIBRARY DESTINATION ${QGIS_PLUGIN_DIR} + ) +endif() diff --git a/src/auth/identcert/core/qgsauthidentcertmethod.cpp b/src/auth/identcert/core/qgsauthidentcertmethod.cpp index d382e5bee2a5..23afa13a92f2 100644 --- a/src/auth/identcert/core/qgsauthidentcertmethod.cpp +++ b/src/auth/identcert/core/qgsauthidentcertmethod.cpp @@ -31,8 +31,8 @@ #include "qgslogger.h" #include "qgsapplication.h" -static const QString AUTH_METHOD_KEY = QStringLiteral( "Identity-Cert" ); -static const QString AUTH_METHOD_DESCRIPTION = QStringLiteral( "Identity certificate authentication" ); +const QString QgsAuthIdentCertMethod::AUTH_METHOD_KEY = QStringLiteral( "Identity-Cert" ); +const QString QgsAuthIdentCertMethod::AUTH_METHOD_DESCRIPTION = tr( "Identity certificate authentication" ); QMap QgsAuthIdentCertMethod::sPkiConfigBundleCache = QMap(); @@ -56,21 +56,16 @@ QgsAuthIdentCertMethod::~QgsAuthIdentCertMethod() sPkiConfigBundleCache.clear(); } -QString QgsAuthIdentCertMethod::key() const +QString QgsAuthIdentCertMethod::key() { return AUTH_METHOD_KEY; } -QString QgsAuthIdentCertMethod::description() const +QString QgsAuthIdentCertMethod::description() { return AUTH_METHOD_DESCRIPTION; } -QString QgsAuthIdentCertMethod::displayDescription() const -{ - return tr( "PKI stored identity certificate" ); -} - bool QgsAuthIdentCertMethod::updateNetworkRequest( QNetworkRequest &request, const QString &authcfg, const QString &dataprovider ) { diff --git a/src/auth/identcert/core/qgsauthidentcertmethod.h b/src/auth/identcert/core/qgsauthidentcertmethod.h index 999d33bbf1ee..92764caa5912 100644 --- a/src/auth/identcert/core/qgsauthidentcertmethod.h +++ b/src/auth/identcert/core/qgsauthidentcertmethod.h @@ -29,15 +29,17 @@ class QgsAuthIdentCertMethod : public QgsAuthMethod Q_OBJECT public: + + static const QString AUTH_METHOD_KEY; + static const QString AUTH_METHOD_DESCRIPTION; + explicit QgsAuthIdentCertMethod(); ~QgsAuthIdentCertMethod() override; // QgsAuthMethod interface - QString key() const override; - - QString description() const override; + static QString key(); - QString displayDescription() const override; + static QString description(); bool updateNetworkRequest( QNetworkRequest &request, const QString &authcfg, const QString &dataprovider = QString() ) override; diff --git a/src/auth/identcert/gui/qgsauthidentcertmethodgui.cpp b/src/auth/identcert/gui/qgsauthidentcertmethodgui.cpp deleted file mode 100644 index a3a934ebb097..000000000000 --- a/src/auth/identcert/gui/qgsauthidentcertmethodgui.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/*************************************************************************** - qgsauthidentcertmethodgui.cpp - --------------------- - begin : September 1, 2015 - copyright : (C) 2015 by Boundless Spatial, Inc. USA - author : Larry Shaffer - email : lshaffer at boundlessgeo dot com - *************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "qgsauthidentcertedit.h" - - -/** - * Optional class factory to return a pointer to a newly created edit widget - */ -QGISEXTERN QgsAuthIdentCertEdit *editWidget( QWidget *parent ) -{ - return new QgsAuthIdentCertEdit( parent ); -} - diff --git a/src/auth/oauth2/CMakeLists.txt b/src/auth/oauth2/CMakeLists.txt index c28262771b51..6c115318cb3e 100644 --- a/src/auth/oauth2/CMakeLists.txt +++ b/src/auth/oauth2/CMakeLists.txt @@ -73,7 +73,6 @@ set(AUTH_OAUTH2_UIS_H "") if (WITH_GUI) set(AUTH_OAUTH2_SRCS ${AUTH_OAUTH2_SRCS} gui/qgsauthoauth2edit.cpp - gui/qgsauthoauth2methodgui.cpp ) set(AUTH_OAUTH2_HDRS ${AUTH_OAUTH2_HDRS} @@ -97,53 +96,72 @@ if(WITH_INTERNAL_O2 AND CMAKE_GENERATOR MATCHES "Ninja") ) endif() -set(_library_suffix_MODULE "") -set(_library_suffix_STATIC "_static") +# static library +add_library(authmethod_oauth2_a STATIC ${AUTH_OAUTH2_SRCS} ${AUTH_OAUTH2_HDRS} ${AUTH_OAUTH2_UIS_H}) -foreach(_library_type MODULE STATIC) - set(_library_name "authmethod_oauth2${_library_suffix_${_library_type}}") +target_include_directories(authmethod_oauth2_a PUBLIC ${CMAKE_SOURCE_DIR}/src/auth/oauth2/core) - add_library(${_library_name} ${_library_type} ${AUTH_OAUTH2_SRCS} ${AUTH_OAUTH2_HDRS} ${AUTH_OAUTH2_UIS_H} ${AUTH_OAUTH2_RCCS}) +# require c++17 +target_compile_features(authmethod_oauth2_a PRIVATE cxx_std_17) - # require c++17 - target_compile_features(${_library_name} PRIVATE cxx_std_17) +target_link_libraries(authmethod_oauth2_a qgis_core) - if(WITH_INTERNAL_O2) - target_include_directories(${_library_name} SYSTEM PUBLIC ${O2_INCLUDE_DIR}) +if(WITH_INTERNAL_O2) + target_include_directories(authmethod_oauth2_a SYSTEM PUBLIC ${O2_INCLUDE_DIR}) +else() + if(NOT "${O2_LIBRARY}" STREQUAL "") + # prefer dynamic linking + target_link_libraries(authmethod_oauth2_a ${O2_LIBRARY}) + else() + target_link_libraries(authmethod_oauth2_a ${O2_LIBRARY_STATIC}) endif() +endif() - target_include_directories(${_library_name} PUBLIC - ${CMAKE_SOURCE_DIR}/external/qjsonwrapper - ${CMAKE_CURRENT_SOURCE_DIR}/core +target_include_directories(authmethod_oauth2_a PRIVATE + ${CMAKE_SOURCE_DIR}/external/qjsonwrapper + ${CMAKE_SOURCE_DIR}/src/auth/oauth2/core +) +if (WITH_GUI) + target_include_directories(authmethod_oauth2_a PRIVATE + ${CMAKE_SOURCE_DIR}/src/auth/oauth2/gui + ${CMAKE_BINARY_DIR}/src/auth/oauth2 ) - target_link_libraries(${_library_name} qgis_core) + target_link_libraries (authmethod_oauth2_a qgis_gui) +endif() - if (WITH_GUI) - target_include_directories(${_library_name} PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/gui - ${CMAKE_CURRENT_BINARY_DIR} - ) - target_link_libraries(${_library_name} qgis_gui) - endif() - if(NOT WITH_INTERNAL_O2) +if (FORCE_STATIC_LIBS) + # for (external) mobile apps to be able to pick up provider for linking + install (TARGETS authmethod_oauth2_a ARCHIVE DESTINATION ${QGIS_PLUGIN_DIR}) +else() + # dynamically loaded module + add_library(authmethod_oauth2 MODULE ${AUTH_OAUTH2_SRCS} ${AUTH_OAUTH2_HDRS} ${AUTH_OAUTH2_UIS_H}) + + # require c++17 + target_compile_features(authmethod_oauth2 PRIVATE cxx_std_17) + + target_link_libraries(authmethod_oauth2 qgis_core) + + if(WITH_INTERNAL_O2) + target_include_directories(authmethod_oauth2 SYSTEM PUBLIC ${O2_INCLUDE_DIR}) + else() if(NOT "${O2_LIBRARY}" STREQUAL "") # prefer dynamic linking - target_link_libraries(${_library_name} ${O2_LIBRARY}) + target_link_libraries(authmethod_oauth2 ${O2_LIBRARY}) else() - target_link_libraries(${_library_name} ${O2_LIBRARY_STATIC}) + target_link_libraries(authmethod_oauth2 ${O2_LIBRARY_STATIC}) endif() endif() - if(WIN32) - add_definitions(-DO2_DLL_EXPORT) + if (WITH_GUI) + target_link_libraries (authmethod_oauth2 qgis_gui) + add_dependencies(authmethod_oauth2 ui) endif() - install(TARGETS ${_library_name} + install (TARGETS authmethod_oauth2 RUNTIME DESTINATION ${QGIS_PLUGIN_DIR} LIBRARY DESTINATION ${QGIS_PLUGIN_DIR} ) -endforeach() - +endif() diff --git a/src/auth/oauth2/core/qgsauthoauth2method.cpp b/src/auth/oauth2/core/qgsauthoauth2method.cpp index 5f571e4e2f45..65b2a46e2306 100644 --- a/src/auth/oauth2/core/qgsauthoauth2method.cpp +++ b/src/auth/oauth2/core/qgsauthoauth2method.cpp @@ -40,8 +40,8 @@ #include #endif -static const QString AUTH_METHOD_KEY = QStringLiteral( "OAuth2" ); -static const QString AUTH_METHOD_DESCRIPTION = QStringLiteral( "OAuth2 authentication" ); +const QString QgsAuthOAuth2Method::AUTH_METHOD_KEY = QStringLiteral( "OAuth2" ); +const QString QgsAuthOAuth2Method::AUTH_METHOD_DESCRIPTION = tr( "OAuth2 authentication" ); QMap QgsAuthOAuth2Method::sOAuth2ConfigCache = QMap(); @@ -89,21 +89,16 @@ QgsAuthOAuth2Method::~QgsAuthOAuth2Method() } } -QString QgsAuthOAuth2Method::key() const +QString QgsAuthOAuth2Method::key() { return AUTH_METHOD_KEY; } -QString QgsAuthOAuth2Method::description() const +QString QgsAuthOAuth2Method::description() { return AUTH_METHOD_DESCRIPTION; } -QString QgsAuthOAuth2Method::displayDescription() const -{ - return tr( "OAuth2 authentication" ); -} - bool QgsAuthOAuth2Method::updateNetworkRequest( QNetworkRequest &request, const QString &authcfg, const QString &dataprovider ) { diff --git a/src/auth/oauth2/core/qgsauthoauth2method.h b/src/auth/oauth2/core/qgsauthoauth2method.h index 647fa94ea84d..be220ee29395 100644 --- a/src/auth/oauth2/core/qgsauthoauth2method.h +++ b/src/auth/oauth2/core/qgsauthoauth2method.h @@ -37,17 +37,18 @@ class QgsAuthOAuth2Method : public QgsAuthMethod Q_OBJECT public: + + static const QString AUTH_METHOD_KEY; + static const QString AUTH_METHOD_DESCRIPTION; + explicit QgsAuthOAuth2Method(); ~QgsAuthOAuth2Method() override; //! OAuth2 method key - QString key() const override; + static QString key(); //! OAuth2 method description - QString description() const override; - - //! Human readable description - QString displayDescription() const override; + static QString description(); //! Update network \a request with given \a authcfg and optional \a dataprovider bool updateNetworkRequest( QNetworkRequest &request, const QString &authcfg, diff --git a/src/auth/oauth2/gui/qgsauthoauth2methodgui.cpp b/src/auth/oauth2/gui/qgsauthoauth2methodgui.cpp deleted file mode 100644 index 57e3951b9b0d..000000000000 --- a/src/auth/oauth2/gui/qgsauthoauth2methodgui.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/*************************************************************************** - qgsauthoauth2methodgui.cpp - --------------------- - begin : July 13, 2016 - copyright : (C) 2016 by Monsanto Company, USA - author : Larry Shaffer, Boundless Spatial - email : lshaffer at boundlessgeo dot com - *************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "qgsauthoauth2edit.h" - -/** - * Optional class factory to return a pointer to a newly created edit widget - */ -QGISEXTERN QgsAuthOAuth2Edit *editWidget( QWidget *parent ) -{ - return new QgsAuthOAuth2Edit( parent ); -} diff --git a/src/auth/pkipaths/CMakeLists.txt b/src/auth/pkipaths/CMakeLists.txt index c182da05727d..4d5beca81d88 100644 --- a/src/auth/pkipaths/CMakeLists.txt +++ b/src/auth/pkipaths/CMakeLists.txt @@ -10,7 +10,6 @@ set(AUTH_PKIPATHS_UIS_H "") if (WITH_GUI) set(AUTH_PKIPATHS_SRCS ${AUTH_PKIPATHS_SRCS} - gui/qgsauthpkipathsmethodgui.cpp gui/qgsauthpkipathsedit.cpp ) set(AUTH_PKIPATHS_HDRS ${AUTH_PKIPATHS_HDRS} @@ -20,33 +19,50 @@ if (WITH_GUI) QT5_WRAP_UI(AUTH_PKIPATHS_UIS_H ${AUTH_PKIPATHS_UIS}) endif() -add_library(authmethod_pkipaths MODULE ${AUTH_PKIPATHS_SRCS} ${AUTH_PKIPATHS_HDRS} ${AUTH_PKIPATHS_UIS_H}) +# static library +add_library(authmethod_pkipaths_a STATIC ${AUTH_PKIPATHS_SRCS} ${AUTH_PKIPATHS_HDRS} ${AUTH_PKIPATHS_UIS_H}) -target_include_directories (authmethod_pkipaths SYSTEM PUBLIC - ${QCA_INCLUDE_DIR} - ${QTKEYCHAIN_INCLUDE_DIR} -) - -target_include_directories(authmethod_pkipaths PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/core -) +target_include_directories(authmethod_pkipaths_a PUBLIC ${CMAKE_SOURCE_DIR}/src/auth/pkipaths/core) # require c++17 -target_compile_features(authmethod_pkipaths PRIVATE cxx_std_17) +target_compile_features(authmethod_pkipaths_a PRIVATE cxx_std_17) -target_link_libraries(authmethod_pkipaths qgis_core) +target_link_libraries(authmethod_pkipaths_a qgis_core) if (WITH_GUI) - target_include_directories(authmethod_pkipaths PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/gui - ${CMAKE_CURRENT_BINARY_DIR} + target_include_directories(authmethod_pkipaths_a PRIVATE + ${CMAKE_SOURCE_DIR}/src/auth/pkipaths/gui + ${CMAKE_BINARY_DIR}/src/auth/pkipaths ) - target_link_libraries(authmethod_pkipaths qgis_gui) + + target_link_libraries (authmethod_pkipaths_a qgis_gui) endif() -target_compile_definitions(authmethod_pkipaths PRIVATE "-DQT_NO_FOREACH") +target_compile_definitions(authmethod_pkipaths_a PRIVATE "-DQT_NO_FOREACH") -install(TARGETS authmethod_pkipaths - RUNTIME DESTINATION ${QGIS_PLUGIN_DIR} - LIBRARY DESTINATION ${QGIS_PLUGIN_DIR} -) + + +if (FORCE_STATIC_LIBS) + # for (external) mobile apps to be able to pick up provider for linking + install (TARGETS authmethod_pkipaths_a ARCHIVE DESTINATION ${QGIS_PLUGIN_DIR}) +else() + # dynamically loaded module + add_library(authmethod_pkipaths MODULE ${AUTH_PKIPATHS_SRCS} ${AUTH_PKIPATHS_HDRS} ${AUTH_PKIPATHS_UIS_H}) + + # require c++17 + target_compile_features(authmethod_pkipaths PRIVATE cxx_std_17) + + target_link_libraries(authmethod_pkipaths qgis_core) + + if (WITH_GUI) + target_link_libraries (authmethod_pkipaths qgis_gui) + add_dependencies(authmethod_pkipaths ui) + endif() + + target_compile_definitions(authmethod_pkipaths PRIVATE "-DQT_NO_FOREACH") + + install (TARGETS authmethod_pkipaths + RUNTIME DESTINATION ${QGIS_PLUGIN_DIR} + LIBRARY DESTINATION ${QGIS_PLUGIN_DIR} + ) +endif() diff --git a/src/auth/pkipaths/core/qgsauthpkipathsmethod.cpp b/src/auth/pkipaths/core/qgsauthpkipathsmethod.cpp index 76c3eaea58aa..8bd1336ab0db 100644 --- a/src/auth/pkipaths/core/qgsauthpkipathsmethod.cpp +++ b/src/auth/pkipaths/core/qgsauthpkipathsmethod.cpp @@ -32,8 +32,8 @@ #include "qgsapplication.h" -static const QString AUTH_METHOD_KEY = QStringLiteral( "PKI-Paths" ); -static const QString AUTH_METHOD_DESCRIPTION = QStringLiteral( "PKI paths authentication" ); +const QString QgsAuthPkiPathsMethod::AUTH_METHOD_KEY = QStringLiteral( "PKI-Paths" ); +const QString QgsAuthPkiPathsMethod::AUTH_METHOD_DESCRIPTION = tr( "PKI paths authentication" ); QMap QgsAuthPkiPathsMethod::sPkiConfigBundleCache = QMap(); @@ -57,20 +57,16 @@ QgsAuthPkiPathsMethod::~QgsAuthPkiPathsMethod() sPkiConfigBundleCache.clear(); } -QString QgsAuthPkiPathsMethod::key() const +QString QgsAuthPkiPathsMethod::key() { return AUTH_METHOD_KEY; } -QString QgsAuthPkiPathsMethod::description() const +QString QgsAuthPkiPathsMethod::description() { return AUTH_METHOD_DESCRIPTION; } -QString QgsAuthPkiPathsMethod::displayDescription() const -{ - return tr( "PKI paths authentication" ); -} bool QgsAuthPkiPathsMethod::updateNetworkRequest( QNetworkRequest &request, const QString &authcfg, const QString &dataprovider ) diff --git a/src/auth/pkipaths/core/qgsauthpkipathsmethod.h b/src/auth/pkipaths/core/qgsauthpkipathsmethod.h index 003fb405242e..6d8855ed8ab4 100644 --- a/src/auth/pkipaths/core/qgsauthpkipathsmethod.h +++ b/src/auth/pkipaths/core/qgsauthpkipathsmethod.h @@ -29,15 +29,17 @@ class QgsAuthPkiPathsMethod : public QgsAuthMethod Q_OBJECT public: + + static const QString AUTH_METHOD_KEY; + static const QString AUTH_METHOD_DESCRIPTION; + explicit QgsAuthPkiPathsMethod(); ~QgsAuthPkiPathsMethod() override; // QgsAuthMethod interface - QString key() const override; - - QString description() const override; + static QString key(); - QString displayDescription() const override; + static QString description(); bool updateNetworkRequest( QNetworkRequest &request, const QString &authcfg, const QString &dataprovider = QString() ) override; diff --git a/src/auth/pkipaths/gui/qgsauthpkipathsmethodgui.cpp b/src/auth/pkipaths/gui/qgsauthpkipathsmethodgui.cpp deleted file mode 100644 index ae3f972c9768..000000000000 --- a/src/auth/pkipaths/gui/qgsauthpkipathsmethodgui.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/*************************************************************************** - qgsauthpkipathsmethodgui.cpp - --------------------- - begin : September 1, 2015 - copyright : (C) 2015 by Boundless Spatial, Inc. USA - author : Larry Shaffer - email : lshaffer at boundlessgeo dot com - *************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "qgsauthpkipathsedit.h" - - -/** - * Optional class factory to return a pointer to a newly created edit widget - */ -QGISEXTERN QgsAuthPkiPathsEdit *editWidget( QWidget *parent ) -{ - return new QgsAuthPkiPathsEdit( parent ); -} - diff --git a/src/auth/pkipkcs12/CMakeLists.txt b/src/auth/pkipkcs12/CMakeLists.txt index c708a0320d00..1520762ac935 100644 --- a/src/auth/pkipkcs12/CMakeLists.txt +++ b/src/auth/pkipkcs12/CMakeLists.txt @@ -10,7 +10,6 @@ set(AUTH_PKCS12_UIS_H "") if (WITH_GUI) set(AUTH_PKCS12_SRCS ${AUTH_PKCS12_SRCS} - gui/qgsauthpkcs12methodgui.cpp gui/qgsauthpkcs12edit.cpp ) set(AUTH_PKCS12_HDRS ${AUTH_PKCS12_HDRS} @@ -20,33 +19,50 @@ if (WITH_GUI) QT5_WRAP_UI(AUTH_PKCS12_UIS_H ${AUTH_PKCS12_UIS}) endif() -add_library(authmethod_pkcs12 MODULE ${AUTH_PKCS12_SRCS} ${AUTH_PKCS12_HDRS} ${AUTH_PKCS12_UIS_H}) +# static library +add_library(authmethod_pkcs12_a STATIC ${AUTH_PKCS12_SRCS} ${AUTH_PKCS12_HDRS} ${AUTH_PKCS12_UIS_H}) -target_include_directories(authmethod_pkcs12 SYSTEM PUBLIC - ${QCA_INCLUDE_DIR} - ${QTKEYCHAIN_INCLUDE_DIR} -) - -target_include_directories(authmethod_pkcs12 PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/core -) +target_include_directories(authmethod_pkcs12_a PUBLIC ${CMAKE_SOURCE_DIR}/src/auth/pkipkcs12/core) # require c++17 -target_compile_features(authmethod_pkcs12 PRIVATE cxx_std_17) +target_compile_features(authmethod_pkcs12_a PRIVATE cxx_std_17) -target_link_libraries(authmethod_pkcs12 qgis_core) +target_link_libraries(authmethod_pkcs12_a qgis_core) if (WITH_GUI) - target_include_directories(authmethod_pkcs12 PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/gui - ${CMAKE_CURRENT_BINARY_DIR} + target_include_directories(authmethod_pkcs12_a PRIVATE + ${CMAKE_SOURCE_DIR}/src/auth/pkipkcs12/gui + ${CMAKE_BINARY_DIR}/src/auth/pkipkcs12 ) - target_link_libraries(authmethod_pkcs12 qgis_gui) + + target_link_libraries (authmethod_pkcs12_a qgis_gui) endif() -target_compile_definitions(authmethod_pkcs12 PRIVATE "-DQT_NO_FOREACH") +target_compile_definitions(authmethod_pkcs12_a PRIVATE "-DQT_NO_FOREACH") -install(TARGETS authmethod_pkcs12 - RUNTIME DESTINATION ${QGIS_PLUGIN_DIR} - LIBRARY DESTINATION ${QGIS_PLUGIN_DIR} -) + + +if (FORCE_STATIC_LIBS) + # for (external) mobile apps to be able to pick up provider for linking + install (TARGETS authmethod_pkcs12_a ARCHIVE DESTINATION ${QGIS_PLUGIN_DIR}) +else() + # dynamically loaded module + add_library(authmethod_pkcs12 MODULE ${AUTH_PKCS12_SRCS} ${AUTH_PKCS12_HDRS} ${AUTH_PKCS12_UIS_H}) + + # require c++17 + target_compile_features(authmethod_pkcs12 PRIVATE cxx_std_17) + + target_link_libraries(authmethod_pkcs12 qgis_core) + + if (WITH_GUI) + target_link_libraries (authmethod_pkcs12 qgis_gui) + add_dependencies(authmethod_pkcs12 ui) + endif() + + target_compile_definitions(authmethod_pkcs12 PRIVATE "-DQT_NO_FOREACH") + + install (TARGETS authmethod_pkcs12 + RUNTIME DESTINATION ${QGIS_PLUGIN_DIR} + LIBRARY DESTINATION ${QGIS_PLUGIN_DIR} + ) +endif() diff --git a/src/auth/pkipkcs12/core/qgsauthpkcs12method.cpp b/src/auth/pkipkcs12/core/qgsauthpkcs12method.cpp index 7f3b49dfcf1a..c4f5b4813e41 100644 --- a/src/auth/pkipkcs12/core/qgsauthpkcs12method.cpp +++ b/src/auth/pkipkcs12/core/qgsauthpkcs12method.cpp @@ -32,8 +32,8 @@ #include "qgsapplication.h" -static const QString AUTH_METHOD_KEY = QStringLiteral( "PKI-PKCS#12" ); -static const QString AUTH_METHOD_DESCRIPTION = QStringLiteral( "PKI PKCS#12 authentication" ); +const QString QgsAuthPkcs12Method::AUTH_METHOD_KEY = QStringLiteral( "PKI-PKCS#12" ); +const QString QgsAuthPkcs12Method::AUTH_METHOD_DESCRIPTION = tr( "PKI PKCS#12 authentication" ); QMap QgsAuthPkcs12Method::sPkiConfigBundleCache = QMap(); @@ -56,21 +56,16 @@ QgsAuthPkcs12Method::~QgsAuthPkcs12Method() sPkiConfigBundleCache.clear(); } -QString QgsAuthPkcs12Method::key() const +QString QgsAuthPkcs12Method::key() { return AUTH_METHOD_KEY; } -QString QgsAuthPkcs12Method::description() const +QString QgsAuthPkcs12Method::description() { return AUTH_METHOD_DESCRIPTION; } -QString QgsAuthPkcs12Method::displayDescription() const -{ - return tr( "PKI PKCS#12 authentication" ); -} - bool QgsAuthPkcs12Method::updateNetworkRequest( QNetworkRequest &request, const QString &authcfg, const QString &dataprovider ) { diff --git a/src/auth/pkipkcs12/core/qgsauthpkcs12method.h b/src/auth/pkipkcs12/core/qgsauthpkcs12method.h index b674a76495b0..d989b7584ad9 100644 --- a/src/auth/pkipkcs12/core/qgsauthpkcs12method.h +++ b/src/auth/pkipkcs12/core/qgsauthpkcs12method.h @@ -29,15 +29,17 @@ class QgsAuthPkcs12Method : public QgsAuthMethod Q_OBJECT public: + + static const QString AUTH_METHOD_KEY; + static const QString AUTH_METHOD_DESCRIPTION; + explicit QgsAuthPkcs12Method(); ~QgsAuthPkcs12Method() override; // QgsAuthMethod interface - QString key() const override; - - QString description() const override; + static QString key(); - QString displayDescription() const override; + static QString description(); bool updateNetworkRequest( QNetworkRequest &request, const QString &authcfg, const QString &dataprovider = QString() ) override; diff --git a/src/auth/pkipkcs12/gui/qgsauthpkcs12methodgui.cpp b/src/auth/pkipkcs12/gui/qgsauthpkcs12methodgui.cpp deleted file mode 100644 index c48f465775e3..000000000000 --- a/src/auth/pkipkcs12/gui/qgsauthpkcs12methodgui.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/*************************************************************************** - qgsauthpkcs12methodgui.cpp - --------------------- - begin : September 1, 2015 - copyright : (C) 2015 by Boundless Spatial, Inc. USA - author : Larry Shaffer - email : lshaffer at boundlessgeo dot com - *************************************************************************** - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - ***************************************************************************/ - -#include "qgsauthpkcs12edit.h" - -/** - * Optional class factory to return a pointer to a newly created edit widget - */ -QGISEXTERN QgsAuthPkcs12Edit *editWidget( QWidget *parent ) -{ - return new QgsAuthPkcs12Edit( parent ); -} - -