Add a new CMake flag to disable deprecated functionality

Anything which is going to disappear can be #ifdef'd with this definition. This
is an additional hint if your 3rd party code is prepared for the next level of
QGIS.

For a start it's used to disable old labelling which causes deadlocks when used
with PyQt5-Python3.
This commit is contained in:
Matthias Kuhn 2016-04-19 15:11:26 +02:00
parent 69153ab068
commit 340f0f2754
3 changed files with 8 additions and 1 deletions

View File

@ -668,6 +668,11 @@ IF (UNIX AND NOT APPLE)
SET (QGIS_MANUAL_DIR ${CMAKE_INSTALL_PREFIX}/${QGIS_MANUAL_SUBDIR})
ENDIF (UNIX AND NOT APPLE)
SET (DISABLE_DEPRECATED ${ENABLE_QT5} CACHE BOOL "If set to true, it will disable deprecated functionality to prepare for the next generation of QGIS")
IF (DISABLE_DEPRECATED)
ADD_DEFINITIONS(-DQGIS_DISABLE_DEPRECATED)
ENDIF (DISABLE_DEPRECATED)
#############################################################
# Python build dependency

View File

@ -35,6 +35,7 @@ cmake \
-DWITH_SERVER=ON \
-DENABLE_QT5=ON \
-DENABLE_PYTHON3=ON \
-DDISABLE_DEPRECATED=ON \
-DPORT_PLUGINS=ON \
-DCXX_EXTRA_FLAGS="$CLANG_WARNINGS" \
..

View File

@ -293,9 +293,10 @@ void QgsMapRendererJob::drawLabeling( const QgsMapSettings& settings, QgsRenderC
renderContext.setPainter( painter );
renderContext.setLabelingEngine( labelingEngine );
#if !defined(QGIS_DISABLE_DEPRECATED)
// old labeling - to be removed at some point...
drawOldLabeling( settings, renderContext );
#endif
drawNewLabeling( settings, renderContext, labelingEngine );
if ( labelingEngine2 )