diff --git a/CMakeLists.txt b/CMakeLists.txt index b29d6e59c927..5392c6054a65 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -271,14 +271,6 @@ if(WITH_CORE) set(HAVE_EPT TRUE) endif() - #BUILD WITH QtMobility by default on android only. Other platform can force it - if (ANDROID) - set (DEFAULT_WITH_QTMOBILITY TRUE) - else() - set (DEFAULT_WITH_QTMOBILITY FALSE) - endif() - set (WITH_QTMOBILITY ${DEFAULT_WITH_QTMOBILITY} CACHE BOOL "Determines if QtMobility related code should be build (for example internal GPS)") - set (WITH_THREAD_LOCAL TRUE CACHE BOOL "Determines whether std::thread_local should be used") mark_as_advanced(WITH_THREAD_LOCAL) @@ -508,10 +500,6 @@ if(WITH_CORE) set(OPTIONAL_QTWEBKIT ${Qt5WebKitWidgets_LIBRARIES}) endif() - if (WITH_QTMOBILITY) - find_package(QtMobility 1.1.0) - endif() - # search for QScintilla2 (C++ lib) if (WITH_GUI) find_package(QScintilla REQUIRED) diff --git a/cmake/FindQtMobility.cmake b/cmake/FindQtMobility.cmake deleted file mode 100644 index f5456c8e5b4e..000000000000 --- a/cmake/FindQtMobility.cmake +++ /dev/null @@ -1,163 +0,0 @@ -#INCLUDE(FindQt4) - -set(MOBILITY_CONFIG_MKSPECS_FILE "") -IF(EXISTS "${QT_MKSPECS_DIR}/features/mobilityconfig.prf") - set(MOBILITY_CONFIG_MKSPECS_FILE "${QT_MKSPECS_DIR}/features/mobilityconfig.prf") -ELSEIF(EXISTS "${QT_MKSPECS_DIR}/features/mobility.prf") - set(MOBILITY_CONFIG_MKSPECS_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmakes/mobilityconfig.prf") -ENDIF() - -macro(export_component component) - IF(NOT ${MOBILITY_CONFIG_MKSPECS_FILE} STREQUAL "") - FILE(READ ${MOBILITY_CONFIG_MKSPECS_FILE} MOBILITY_FILE_CONTENTS) - STRING(TOLOWER ${component} _COMPONENT) - IF(${MOBILITY_FILE_CONTENTS} MATCHES "MOBILITY_CONFIG=.*${_COMPONENT}.*") - STRING(TOUPPER ${component} _COMPONENT) - SET(QT_MOBILITY_${_COMPONENT}_FOUND 1) - SET(QT_MOBILITY_${_COMPONENT}_INCLUDE_DIR ${QT_MOBILITY_PARENT_INCLUDE_DIR}/Qt${component}) - SET(QT_MOBILITY_${_COMPONENT}_LIBRARY ${QT_LIBRARY_DIR}/libQt${component}.so) - ADD_DEFINITIONS(-DHAVE_QT_MOBILITY_${_COMPONENT}) - ENDIF() - ENDIF() -endmacro() - -set(VERSION_INFO "") -set(FEATURE_FILE_PREFIX "${QT_MKSPECS_DIR}/features/mobility") - -if(DEFINED MOBILITY_VERSION) - if(MOBILITY_VERSION STREQUAL "1.1" AND EXISTS "${FEATURE_FILE_PREFIX}11.prf") - set(MOBILITY_PRF_FILE "${FEATURE_FILE_PREFIX}11.prf") - set(VERSION_INFO "1.1") - elseif(MOBILITY_VERSION STREQUAL "1.2" AND EXISTS "${FEATURE_FILE_PREFIX}12.prf") - set(MOBILITY_PRF_FILE "${FEATURE_FILE_PREFIX}12.prf") - set(VERSION_INFO "1.2") - elseif(MOBILITY_VERSION STREQUAL "default" AND EXISTS "${FEATURE_FILE_PREFIX}.prf") - set(MOBILITY_PRF_FILE "${FEATURE_FILE_PREFIX}.prf") - set(VERSION_INFO "system's default") - else() - message(STATUS "Couldn't find QtMobility version: ${MOBILITY_VERSION}") - endif() -endif() - -if(NOT DEFINED MOBILITY_PRF_FILE) - if(EXISTS "${FEATURE_FILE_PREFIX}.prf") - set(MOBILITY_PRF_FILE "${FEATURE_FILE_PREFIX}.prf") - set(VERSION_INFO "system's default") - elseif(EXISTS "${FEATURE_FILE_PREFIX}12.prf") - set(MOBILITY_PRF_FILE "${FEATURE_FILE_PREFIX}12.prf") - set(VERSION_INFO "1.2") - elseif(EXISTS "${FEATURE_FILE_PREFIX}11.prf") - set(MOBILITY_PRF_FILE "${FEATURE_FILE_PREFIX}11.prf") - set(VERSION_INFO "1.1") - else() - message(FATAL_ERROR "Couldn't find any version of QtMobility.") - endif() -endif() - -message(STATUS "Using QtMobility version: ${VERSION_INFO}") - -IF(DEFINED MOBILITY_PRF_FILE) - FILE(READ ${MOBILITY_PRF_FILE} MOBILITY_FILE_CONTENTS) - - STRING(REGEX MATCH "MOBILITY_PREFIX=([^\n]+)" QT_MOBILITY_PREFIX "${MOBILITY_FILE_CONTENTS}") - SET(QT_MOBILITY_PREFIX ${CMAKE_MATCH_1}) - - STRING(REGEX MATCH "MOBILITY_INCLUDE=([^\n]+)" QT_MOBILITY_INCLUDE_DIR "${MOBILITY_FILE_CONTENTS}") - SET(QT_MOBILITY_INCLUDE_DIR ${CMAKE_MATCH_1}) - - STRING(REGEX MATCH "MOBILITY_LIB=([^\n]+)" "\\1" QT_MOBILITY_LIBRARY "${MOBILITY_FILE_CONTENTS}") - SET(QT_MOBILITY_LIBRARY_DIR ${CMAKE_MATCH_1}) - - #VERSION - IF(NOT ${MOBILITY_CONFIG_MKSPECS_FILE} STREQUAL "") - FILE(READ ${MOBILITY_CONFIG_MKSPECS_FILE} MOBILITY_CONFIG_FILE_CONTENTS) - STRING(REGEX MATCH "MOBILITY_VERSION = ([^\n]+)" QT_MOBILITY_VERSION "${MOBILITY_CONFIG_FILE_CONTENTS}") - SET(QT_MOBILITY_VERSION ${CMAKE_MATCH_1}) - - STRING(REGEX MATCH "MOBILITY_MAJOR_VERSION = ([^\n]+)" QT_MOBILITY_MAJOR_VERSION "${MOBILITY_CONFIG_FILE_CONTENTS}") - SET(QT_MOBILITY_MAJOR_VERSION ${CMAKE_MATCH_1}) - - STRING(REGEX MATCH "MOBILITY_MINOR_VERSION = ([^\n]+)" QT_MOBILITY_MINOR_VERSION "${MOBILITY_CONFIG_FILE_CONTENTS}") - SET(QT_MOBILITY_MINOR_VERSION ${CMAKE_MATCH_1}) - - STRING(REGEX MATCH "MOBILITY_PATCH_VERSION = ([^\n]+)" QT_MOBILITY_PATCH_VERSION "${MOBILITY_CONFIG_FILE_CONTENTS}") - SET(QT_MOBILITY_PATCH_VERSION ${CMAKE_MATCH_1}) - - message(STATUS "QtMobility version: ${QT_MOBILITY_VERSION}") - ELSE() - SET(QT_MOBILITY_VERSION 1.0.0) - SET(QT_MOBILITY_MAJOR_VERSION 1) - SET(QT_MOBILITY_MINOR_VERSION 0) - SET(QT_MOBILITY_PATCH_VERSION 0) - ENDIF() - - SET(QT_MOBILITY_PARENT_INCLUDE_DIR ${QT_MOBILITY_INCLUDE_DIR}) - SET(QT_MOBILITY_INCLUDE_DIR ${QT_MOBILITY_INCLUDE_DIR}/QtMobility) - - IF(QtMobility_FIND_VERSION_EXACT) - IF(QT_MOBILITY_VERSION VERSION_EQUAL QtMobility_FIND_VERSION) - SET(QT_MOBILITY_FOUND TRUE) - ELSE() - SET(QT_MOBILITY_FOUND FALSE) - IF(QT_MOBILITY_VERSION VERSION_LESS QtMobility_FIND_VERSION) - SET(QT_MOBILITY_TOO_OLD TRUE) - ELSE() - SET(QT_MOBILITY_TOO_NEW TRUE) - ENDIF() - ENDIF() - ELSE() - IF(QT_MOBILITY_VERSION VERSION_LESS QtMobility_FIND_VERSION) - SET(QT_MOBILITY_FOUND FALSE) - SET(QT_MOBILITY_TOO_OLD TRUE) - ELSE() - SET(QT_MOBILITY_FOUND TRUE) - ENDIF() - ENDIF() -ELSE() - SET(QT_MOBILITY_FOUND NOTFOUND) - SET(QT_MOBILITY_PREFIX NOTFOUND) - SET(QT_MOBILITY_INCLUDE NOTFOUND) - SET(QT_MOBILITY_LIB NOTFOUND) -ENDIF() - -IF(NOT QT_MOBILITY_FOUND) - if(QT_MOBILITY_TOO_OLD) - MESSAGE(FATAL_ERROR "The installed QtMobility version ${QT_MOBILITY_VERSION} it too old, version ${QtMobility_FIND_VERSION} is required.") - ELSEIF(QT_MOBILITY_TOO_NEW) - MESSAGE(FATAL_ERROR "The installed QtMobility version ${QT_MOBILITY_VERSION} it too new, version ${QtMobility_FIND_VERSION} is required.") - ELSE() - MESSAGE(FATAL_ERROR "QtMobility not found.") - ENDIF() -ELSE() - INCLUDE_DIRECTORIES(${QT_MOBILITY_INCLUDE_DIR}) - export_component(Bearer) - export_component(Feedback) - export_component(Gallery) - export_component(PublishSubscribe) - export_component(Location) - export_component(Organizer) - export_component(ServiceFramework) - export_component(SystemInfo) - export_component(Contacts) - export_component(Connectivity) - export_component(Messaging) - export_component(Versit) - export_component(Sensors) - # VersitOrganizer - if(QT_MOBILITY_VERSIT_FOUND AND QT_MOBILITY_ORGANIZER_FOUND) - SET(QT_MOBILITY_VERSITORGANIZER_FOUND 1) - SET(QT_MOBILITY_VERSITORGANIZER_INCLUDE_DIR ${QT_MOBILITY_PARENT_INCLUDE_DIR}/QtVersitOrganizer) - SET(QT_MOBILITY_VERSITORGANIZER_LIBRARY QtVersitOrganizer) - endif() - - # MultimediaKit - it's just 'multimedia' in the .prf file. - IF(NOT ${MOBILITY_CONFIG_MKSPECS_FILE} STREQUAL "") - FILE(READ ${MOBILITY_CONFIG_MKSPECS_FILE} MOBILITY_FILE_CONTENTS) - IF(${MOBILITY_FILE_CONTENTS} MATCHES "MOBILITY_CONFIG=.*multimedia.*") - SET(QT_MOBILITY_MULTIMEDIAKIT_FOUND 1) - SET(QT_MOBILITY_MULTIMEDIAKIT_INCLUDE_DIR ${QT_MOBILITY_PARENT_INCLUDE_DIR}/QtMultimediaKit) - SET(QT_MOBILITY_MULTIMEDIAKIT_LIBRARY QtMultimediaKit) - ENDIF() - ENDIF() - -ENDIF() diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index ba09c6ffbca5..951c4f696752 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -121,10 +121,6 @@ else() set(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} ARM) endif() -if(NOT QT_MOBILITY_LOCATION_FOUND) - set(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} MOBILITY_LOCATION) -endif() - # SIP 4.19.7+ can: # * prepend auto-generated Python signature to existing Docstrings # * document template based classes diff --git a/python/core/auto_generated/gps/qgsqtlocationconnection.sip.in b/python/core/auto_generated/gps/qgsqtlocationconnection.sip.in index 6a7e236d820b..5b2e3320fa42 100644 --- a/python/core/auto_generated/gps/qgsqtlocationconnection.sip.in +++ b/python/core/auto_generated/gps/qgsqtlocationconnection.sip.in @@ -11,10 +11,6 @@ -%Feature MOBILITY_LOCATION - -%If (MOBILITY_LOCATION) - class QgsQtLocationConnection: QgsGpsConnection { %Docstring(signature="appended") @@ -44,8 +40,6 @@ Parse available data source content %End -%If (!ANDROID) - void satellitesInViewUpdated( const QList &satellites ); %Docstring Called when the number of satellites in view is updated. @@ -64,12 +58,8 @@ Called when the number of satellites in use is updated. not available in Python bindings on android %End -%End - }; -%End // MOBILITY_LOCATION - /************************************************************************ * This file has been generated automatically from * * * diff --git a/python/core/core.sip.in b/python/core/core.sip.in index 6ef4bbf81797..0fdd6de3c2a6 100644 --- a/python/core/core.sip.in +++ b/python/core/core.sip.in @@ -97,6 +97,7 @@ done: %Import QtPrintSupport/QtPrintSupportmod.sip %Import QtWidgets/QtWidgetsmod.sip +%Import QtPositioning/QtPositioningmod.sip %Feature ANDROID %Feature VECTOR_MAPPED_TYPE diff --git a/src/app/gps/qgsgpsinformationwidget.cpp b/src/app/gps/qgsgpsinformationwidget.cpp index 8ef6fc75a44a..a30af0d08293 100644 --- a/src/app/gps/qgsgpsinformationwidget.cpp +++ b/src/app/gps/qgsgpsinformationwidget.cpp @@ -287,14 +287,11 @@ QgsGpsInformationWidget::QgsGpsInformationWidget( QgsMapCanvas *mapCanvas, QWidg { mRadGpsd->setChecked( true ); } - //hide the internal port method if build is without QtLocation -#ifndef HAVE_QT_MOBILITY_LOCATION if ( mRadInternal->isChecked() ) { mRadAutodetect->setChecked( true ); } mRadInternal->hide(); -#endif //auto digitizing behavior mCbxAutoAddVertices->setChecked( mySettings.value( QStringLiteral( "gps/autoAddVertices" ), "false" ).toBool() ); diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 07961f7e82a8..ea04a91ee18c 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -832,7 +832,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") set_source_files_properties(qgsspatialindex.cpp PROPERTIES COMPILE_FLAGS -Wno-overloaded-virtual) endif() -if (QT_MOBILITY_LOCATION_FOUND OR ${QT_VERSION_BASE}Positioning_FOUND) +if (${QT_VERSION_BASE}Positioning_FOUND) set(QGIS_CORE_SRCS ${QGIS_CORE_SRCS} gps/qgsqtlocationconnection.cpp ) @@ -1682,7 +1682,7 @@ if (NOT WITH_QTWEBKIT) ) endif() -if (QT_MOBILITY_LOCATION_FOUND OR ${QT_VERSION_BASE}Positioning_FOUND) +if (${QT_VERSION_BASE}Positioning_FOUND) set(QGIS_CORE_HDRS ${QGIS_CORE_HDRS} gps/qgsqtlocationconnection.h ) @@ -1715,7 +1715,7 @@ endif() # install qgsconfig.h and plugin.h here so they can get into # the OS X framework target -if (QT_MOBILITY_LOCATION_FOUND OR ${QT_VERSION_BASE}Positioning_FOUND) +if (${QT_VERSION_BASE}Positioning_FOUND) set(QGIS_CORE_HDRS ${QGIS_CORE_HDRS} gps/qgsqtlocationconnection.h gps/qgsgpsconnectionregistry.h @@ -1966,10 +1966,6 @@ if (APPLE AND NOT IOS) target_link_libraries(qgis_core qgis_native) endif() -if (QT_MOBILITY_LOCATION_FOUND) - target_link_libraries(qgis_core ${QT_MOBILITY_LOCATION_LIBRARY}) -endif() - if (ADD_CLAZY_CHECKS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_BASE_FLAGS} -Xclang -plugin-arg-clazy -Xclang ${CLAZY_BASE_CHECKS},non-pod-global-static") endif() diff --git a/src/core/gps/qgsgpsdetector.cpp b/src/core/gps/qgsgpsdetector.cpp index c49d3b9b1624..c73a6bd876f7 100644 --- a/src/core/gps/qgsgpsdetector.cpp +++ b/src/core/gps/qgsgpsdetector.cpp @@ -22,7 +22,7 @@ #include "qgsgpsdconnection.h" #include "qgssettings.h" -#if defined(HAVE_QT_MOBILITY_LOCATION ) || defined(QT_POSITIONING_LIB) +#if defined(QT_POSITIONING_LIB) #include "qgsqtlocationconnection.h" #endif @@ -40,7 +40,7 @@ QList< QPair > QgsGpsDetector::availablePorts() QList< QPair > devs; // try local QtLocation first -#if defined(HAVE_QT_MOBILITY_LOCATION ) || defined(QT_POSITIONING_LIB) +#if defined(QT_POSITIONING_LIB) devs << QPair( QStringLiteral( "internalGPS" ), tr( "internal GPS" ) ); #endif @@ -110,10 +110,10 @@ void QgsGpsDetector::advance() } else if ( mPortList.at( mPortIndex ).first.contains( QLatin1String( "internalGPS" ) ) ) { -#if defined(HAVE_QT_MOBILITY_LOCATION ) || defined(QT_POSITIONING_LIB) +#if defined(QT_POSITIONING_LIB) mConn = std::make_unique< QgsQtLocationConnection >(); #else - qWarning( "QT_MOBILITY_LOCATION not found and mPortList matches internalGPS, this should never happen" ); + qWarning( "QT_POSITIONING_LIB not found and mPortList matches internalGPS, this should never happen" ); #endif } else diff --git a/src/core/gps/qgsqtlocationconnection.cpp b/src/core/gps/qgsqtlocationconnection.cpp index b4c7af60654c..3e093a59516f 100644 --- a/src/core/gps/qgsqtlocationconnection.cpp +++ b/src/core/gps/qgsqtlocationconnection.cpp @@ -104,11 +104,7 @@ void QgsQtLocationConnection::satellitesInViewUpdated( QgsSatelliteInfo satelliteInfo; satelliteInfo.azimuth = currentSatellite.attribute( QGeoSatelliteInfo::Azimuth ); satelliteInfo.elevation = currentSatellite.attribute( QGeoSatelliteInfo::Elevation ); -#if defined(HAVE_QT_MOBILITY_LOCATION ) - satelliteInfo.id = currentSatellite.prnNumber(); -#else // QtPositioning satelliteInfo.id = currentSatellite.satelliteIdentifier(); -#endif satelliteInfo.signal = currentSatellite.signalStrength(); mLastGPSInformation.satellitesInView.append( satelliteInfo ); } @@ -127,20 +123,12 @@ void QgsQtLocationConnection::satellitesInUseUpdated( for ( const QGeoSatelliteInfo ¤tSatellite : satellites ) { //add pnr to mLastGPSInformation.satPrn -#if defined(HAVE_QT_MOBILITY_LOCATION ) - mLastGPSInformation.satPrn.append( currentSatellite.prnNumber() ); -#else // QtPositioning mLastGPSInformation.satPrn.append( currentSatellite.satelliteIdentifier() ); -#endif //set QgsSatelliteInfo.inuse to true for the satellites in use for ( QgsSatelliteInfo &satInView : mLastGPSInformation.satellitesInView ) { -#if defined(HAVE_QT_MOBILITY_LOCATION ) - if ( satInView.id == currentSatellite.prnNumber() ) -#else // QtPositioning if ( satInView.id == currentSatellite.satelliteIdentifier() ) -#endif { satInView.inUse = true; break; diff --git a/src/core/gps/qgsqtlocationconnection.h b/src/core/gps/qgsqtlocationconnection.h index db8badbe1a0b..9778a060c56c 100644 --- a/src/core/gps/qgsqtlocationconnection.h +++ b/src/core/gps/qgsqtlocationconnection.h @@ -24,23 +24,9 @@ #include -#ifndef SIP_RUN -#if defined(HAVE_QT_MOBILITY_LOCATION ) -#include -#include -#include - -QTM_USE_NAMESPACE -#else // Using QtPositioning #include #include #include -#endif -#endif - -SIP_FEATURE( MOBILITY_LOCATION ) - -SIP_IF_FEATURE( MOBILITY_LOCATION ) /** * \ingroup core @@ -67,10 +53,6 @@ class CORE_EXPORT QgsQtLocationConnection: public QgsGpsConnection */ void positionUpdated( const QGeoPositionInfo &info ) SIP_SKIP; -#ifdef SIP_RUN - SIP_IF_FEATURE( !ANDROID ) -#endif - /** * Called when the number of satellites in view is updated. * \note not available in Python bindings on android @@ -83,10 +65,6 @@ class CORE_EXPORT QgsQtLocationConnection: public QgsGpsConnection */ void satellitesInUseUpdated( const QList &satellites ); -#ifdef SIP_RUN - SIP_END -#endif - private: void startGPS(); void startSatelliteMonitor(); @@ -97,6 +75,4 @@ class CORE_EXPORT QgsQtLocationConnection: public QgsGpsConnection }; -SIP_END // MOBILITY_LOCATION - #endif // QGSQTLOCATIONCONNECTION_H