Skip to content

Commit

Permalink
Add a new CMake flag to disable deprecated functionality
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
m-kuhn committed Apr 19, 2016
1 parent 69153ab commit 340f0f2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions ci/travis/linux/qt5/install.sh
Expand Up @@ -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" \
..
3 changes: 2 additions & 1 deletion src/core/qgsmaprenderercustompainterjob.cpp
Expand Up @@ -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 )
Expand Down

0 comments on commit 340f0f2

Please sign in to comment.