Skip to content

Commit

Permalink
Also hide ArcGIS provider actions if provider is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Jun 3, 2016
1 parent 6e66eef commit 8f15877
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Expand Up @@ -200,7 +200,6 @@ FIND_PACKAGE(GDAL)
FIND_PACKAGE(Expat REQUIRED)
FIND_PACKAGE(Spatialindex REQUIRED)
FIND_PACKAGE(Qwt REQUIRED)
FIND_PACKAGE(QJSON)

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

# search for QJSON and decide whether to enable ArcGIS providers
FIND_PACKAGE (QJSON)
IF (QJSON_FOUND AND NOT ENABLE_QT5)
SET (WITH_ARCGIS TRUE)
ENDIF (QJSON_FOUND AND NOT ENABLE_QT5)

# Master password hash and authentication encryption
FIND_PACKAGE(QCA REQUIRED)
# Check for runtime dependency of qca-ossl plugin
Expand Down
2 changes: 2 additions & 0 deletions cmake_templates/qgsconfig.h.in
Expand Up @@ -56,5 +56,7 @@

#cmakedefine ENABLE_MODELTEST

#cmakedefine WITH_ARCGIS

#endif

11 changes: 11 additions & 0 deletions src/app/qgisapp.cpp
Expand Up @@ -1676,6 +1676,13 @@ void QgisApp::createActions()
mActionAddPgLayer = 0;
#endif

#ifndef WITH_ARCGIS
delete mActionAddAfsLayer;
mActionAddAfsLayer = 0;
delete mActionAddAmsLayer;
mActionAddAmsLayer = 0;
#endif

#ifndef HAVE_ORACLE
delete mActionAddOracleLayer;
mActionAddOracleLayer = nullptr;
Expand Down Expand Up @@ -2126,6 +2133,7 @@ void QgisApp::createToolBars()
newLayerAction->setObjectName( "ActionNewLayer" );
connect( bt, SIGNAL( triggered( QAction * ) ), this, SLOT( toolButtonActionTriggered( QAction * ) ) );

#ifdef WITH_ARCGIS
// map service tool button
bt = new QToolButton();
bt->setPopupMode( QToolButton::MenuButtonPopup );
Expand Down Expand Up @@ -2167,6 +2175,7 @@ void QgisApp::createToolBars()
mLayerToolBar->removeAction( mActionAddWfsLayer );
featureServiceAction->setObjectName( "ActionFeatureService" );
connect( bt, SIGNAL( triggered( QAction * ) ), this, SLOT( toolButtonActionTriggered( QAction * ) ) );
#endif

// add db layer button
bt = new QToolButton();
Expand Down Expand Up @@ -2545,8 +2554,10 @@ void QgisApp::setTheme( const QString& theThemeName )
mActionAddWmsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddWmsLayer.svg" ) );
mActionAddWcsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddWcsLayer.svg" ) );
mActionAddWfsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddWfsLayer.svg" ) );
#ifdef WITH_ARCGIS
mActionAddAfsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddAfsLayer.svg" ) );
mActionAddAmsLayer->setIcon( QgsApplication::getThemeIcon( "/mActionAddAmsLayer.svg" ) );
#endif
mActionAddToOverview->setIcon( QgsApplication::getThemeIcon( "/mActionInOverview.svg" ) );
mActionAnnotation->setIcon( QgsApplication::getThemeIcon( "/mActionAnnotation.png" ) );
mActionFormAnnotation->setIcon( QgsApplication::getThemeIcon( "/mActionFormAnnotation.png" ) );
Expand Down
6 changes: 3 additions & 3 deletions src/providers/CMakeLists.txt
Expand Up @@ -2,9 +2,9 @@
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR})
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR})

IF(QJSON_FOUND AND NOT ENABLE_QT5)
ADD_SUBDIRECTORY(arcgisrest)
ENDIF(QJSON_FOUND AND NOT ENABLE_QT5)
IF(WITH_ARCGIS)
ADD_SUBDIRECTORY(arcgisrest)
ENDIF(WITH_ARCGIS)
ADD_SUBDIRECTORY(memory)
ADD_SUBDIRECTORY(ogr)
ADD_SUBDIRECTORY(wms)
Expand Down

0 comments on commit 8f15877

Please sign in to comment.