Skip to content

Commit 8f15877

Browse files
committed
Also hide ArcGIS provider actions if provider is disabled
1 parent 6e66eef commit 8f15877

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

CMakeLists.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ FIND_PACKAGE(GDAL)
200200
FIND_PACKAGE(Expat REQUIRED)
201201
FIND_PACKAGE(Spatialindex REQUIRED)
202202
FIND_PACKAGE(Qwt REQUIRED)
203-
FIND_PACKAGE(QJSON)
204203

205204
IF (WITH_INTERNAL_QEXTSERIALPORT)
206205
SET(QEXTSERIALPORT_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/core/gps/qextserialport)
@@ -313,6 +312,12 @@ ENDIF (WITH_TOUCH)
313312
# search for QScintilla2 (C++ lib)
314313
FIND_PACKAGE(QScintilla REQUIRED)
315314

315+
# search for QJSON and decide whether to enable ArcGIS providers
316+
FIND_PACKAGE (QJSON)
317+
IF (QJSON_FOUND AND NOT ENABLE_QT5)
318+
SET (WITH_ARCGIS TRUE)
319+
ENDIF (QJSON_FOUND AND NOT ENABLE_QT5)
320+
316321
# Master password hash and authentication encryption
317322
FIND_PACKAGE(QCA REQUIRED)
318323
# Check for runtime dependency of qca-ossl plugin

cmake_templates/qgsconfig.h.in

+2
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,7 @@
5656

5757
#cmakedefine ENABLE_MODELTEST
5858

59+
#cmakedefine WITH_ARCGIS
60+
5961
#endif
6062

src/app/qgisapp.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -1676,6 +1676,13 @@ void QgisApp::createActions()
16761676
mActionAddPgLayer = 0;
16771677
#endif
16781678

1679+
#ifndef WITH_ARCGIS
1680+
delete mActionAddAfsLayer;
1681+
mActionAddAfsLayer = 0;
1682+
delete mActionAddAmsLayer;
1683+
mActionAddAmsLayer = 0;
1684+
#endif
1685+
16791686
#ifndef HAVE_ORACLE
16801687
delete mActionAddOracleLayer;
16811688
mActionAddOracleLayer = nullptr;
@@ -2126,6 +2133,7 @@ void QgisApp::createToolBars()
21262133
newLayerAction->setObjectName( "ActionNewLayer" );
21272134
connect( bt, SIGNAL( triggered( QAction * ) ), this, SLOT( toolButtonActionTriggered( QAction * ) ) );
21282135

2136+
#ifdef WITH_ARCGIS
21292137
// map service tool button
21302138
bt = new QToolButton();
21312139
bt->setPopupMode( QToolButton::MenuButtonPopup );
@@ -2167,6 +2175,7 @@ void QgisApp::createToolBars()
21672175
mLayerToolBar->removeAction( mActionAddWfsLayer );
21682176
featureServiceAction->setObjectName( "ActionFeatureService" );
21692177
connect( bt, SIGNAL( triggered( QAction * ) ), this, SLOT( toolButtonActionTriggered( QAction * ) ) );
2178+
#endif
21702179

21712180
// add db layer button
21722181
bt = new QToolButton();
@@ -2545,8 +2554,10 @@ void QgisApp::setTheme( const QString& theThemeName )
25452554
mActionAddWmsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddWmsLayer.svg" ) );
25462555
mActionAddWcsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddWcsLayer.svg" ) );
25472556
mActionAddWfsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddWfsLayer.svg" ) );
2557+
#ifdef WITH_ARCGIS
25482558
mActionAddAfsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddAfsLayer.svg" ) );
25492559
mActionAddAmsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddAmsLayer.svg" ) );
2560+
#endif
25502561
mActionAddToOverview->setIcon( QgsApplication::getThemeIcon( "/mActionInOverview.svg" ) );
25512562
mActionAnnotation->setIcon( QgsApplication::getThemeIcon( "/mActionAnnotation.png" ) );
25522563
mActionFormAnnotation->setIcon( QgsApplication::getThemeIcon( "/mActionFormAnnotation.png" ) );

src/providers/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR})
33
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR})
44

5-
IF(QJSON_FOUND AND NOT ENABLE_QT5)
6-
ADD_SUBDIRECTORY(arcgisrest)
7-
ENDIF(QJSON_FOUND AND NOT ENABLE_QT5)
5+
IF(WITH_ARCGIS)
6+
ADD_SUBDIRECTORY(arcgisrest)
7+
ENDIF(WITH_ARCGIS)
88
ADD_SUBDIRECTORY(memory)
99
ADD_SUBDIRECTORY(ogr)
1010
ADD_SUBDIRECTORY(wms)

0 commit comments

Comments
 (0)