diff --git a/src/core/digitizinglogger.cpp b/src/core/digitizinglogger.cpp index b07a25ab53..481d65ce2b 100644 --- a/src/core/digitizinglogger.cpp +++ b/src/core/digitizinglogger.cpp @@ -129,7 +129,7 @@ void DigitizingLogger::findLogsLayer() if ( item ) { QgsVectorLayer *layer = qobject_cast( item->layer() ); - if ( layer && layer->geometryType() == Qgis::GeometryType::Point && layer->dataProvider() && layer->dataProvider()->capabilities() & QgsVectorDataProvider::AddFeatures ) + if ( layer && layer->geometryType() == Qgis::GeometryType::Point && layer->dataProvider() && layer->dataProvider()->capabilities() & Qgis::VectorProviderCapability::AddFeatures ) { mLogsLayer = layer; } diff --git a/src/core/layertreemodel.cpp b/src/core/layertreemodel.cpp index 320817e65a..e99a73e3e9 100644 --- a/src/core/layertreemodel.cpp +++ b/src/core/layertreemodel.cpp @@ -783,7 +783,7 @@ QVariant FlatLayerTreeModelBase::data( const QModelIndex &index, int role ) cons QgsVectorLayer *layer = qobject_cast( nodeLayer->layer() ); if ( layer && layer->dataProvider() ) - return static_cast( layer->dataProvider()->capabilities() & QgsVectorDataProvider::Capability::ReloadData ); + return static_cast( layer->dataProvider()->capabilities() & Qgis::VectorProviderCapability::ReloadData ); } return false; diff --git a/src/core/multifeaturelistmodelbase.cpp b/src/core/multifeaturelistmodelbase.cpp index fc2a085028..9abc1c6a28 100644 --- a/src/core/multifeaturelistmodelbase.cpp +++ b/src/core/multifeaturelistmodelbase.cpp @@ -268,12 +268,12 @@ QVariant MultiFeatureListModelBase::data( const QModelIndex &index, int role ) c case MultiFeatureListModel::DeleteFeatureRole: return !feature->first->readOnly() - && ( feature->first->dataProvider()->capabilities() & QgsVectorDataProvider::DeleteFeatures ) + && ( feature->first->dataProvider()->capabilities() & Qgis::VectorProviderCapability::DeleteFeatures ) && !feature->first->customProperty( QStringLiteral( "QFieldSync/is_geometry_locked" ), false ).toBool(); case MultiFeatureListModel::EditGeometryRole: return !feature->first->readOnly() - && ( feature->first->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeGeometries ) + && ( feature->first->dataProvider()->capabilities() & Qgis::VectorProviderCapability::ChangeGeometries ) && !feature->first->customProperty( QStringLiteral( "QFieldSync/is_geometry_locked" ), false ).toBool(); } @@ -324,7 +324,7 @@ bool MultiFeatureListModelBase::canEditAttributesSelection() const return false; QgsVectorLayer *vlayer = mSelectedFeatures[0].first; - return !vlayer->readOnly() && ( vlayer->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeAttributeValues ); + return !vlayer->readOnly() && ( vlayer->dataProvider()->capabilities() & Qgis::VectorProviderCapability::ChangeAttributeValues ); } bool MultiFeatureListModelBase::canMergeSelection() const @@ -333,7 +333,7 @@ bool MultiFeatureListModelBase::canMergeSelection() const return false; QgsVectorLayer *vlayer = mSelectedFeatures[0].first; - return !vlayer->readOnly() && QgsWkbTypes::isMultiType( vlayer->wkbType() ) && ( vlayer->dataProvider()->capabilities() & QgsVectorDataProvider::DeleteFeatures ) && ( vlayer->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeGeometries ) && !vlayer->customProperty( QStringLiteral( "QFieldSync/is_geometry_locked" ), false ).toBool(); + return !vlayer->readOnly() && QgsWkbTypes::isMultiType( vlayer->wkbType() ) && ( vlayer->dataProvider()->capabilities() & Qgis::VectorProviderCapability::DeleteFeatures ) && ( vlayer->dataProvider()->capabilities() & Qgis::VectorProviderCapability::ChangeGeometries ) && !vlayer->customProperty( QStringLiteral( "QFieldSync/is_geometry_locked" ), false ).toBool(); } bool MultiFeatureListModelBase::canDeleteSelection() const @@ -342,7 +342,7 @@ bool MultiFeatureListModelBase::canDeleteSelection() const return false; QgsVectorLayer *vlayer = mSelectedFeatures[0].first; - return !vlayer->readOnly() && ( vlayer->dataProvider()->capabilities() & QgsVectorDataProvider::DeleteFeatures ) && !vlayer->customProperty( QStringLiteral( "QFieldSync/is_geometry_locked" ), false ).toBool(); + return !vlayer->readOnly() && ( vlayer->dataProvider()->capabilities() & Qgis::VectorProviderCapability::DeleteFeatures ) && !vlayer->customProperty( QStringLiteral( "QFieldSync/is_geometry_locked" ), false ).toBool(); } bool MultiFeatureListModelBase::canDuplicateSelection() const @@ -351,7 +351,7 @@ bool MultiFeatureListModelBase::canDuplicateSelection() const return false; QgsVectorLayer *vlayer = mSelectedFeatures[0].first; - return !vlayer->readOnly() && ( vlayer->dataProvider()->capabilities() & QgsVectorDataProvider::AddFeatures ) && !vlayer->customProperty( QStringLiteral( "QFieldSync/is_geometry_locked" ), false ).toBool(); + return !vlayer->readOnly() && ( vlayer->dataProvider()->capabilities() & Qgis::VectorProviderCapability::AddFeatures ) && !vlayer->customProperty( QStringLiteral( "QFieldSync/is_geometry_locked" ), false ).toBool(); } bool MultiFeatureListModelBase::canMoveSelection() const @@ -360,7 +360,7 @@ bool MultiFeatureListModelBase::canMoveSelection() const return false; QgsVectorLayer *vlayer = mSelectedFeatures[0].first; - if ( !vlayer || vlayer->readOnly() || !( vlayer->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeGeometries ) || vlayer->customProperty( QStringLiteral( "QFieldSync/is_geometry_locked" ), false ).toBool() ) + if ( !vlayer || vlayer->readOnly() || !( vlayer->dataProvider()->capabilities() & Qgis::VectorProviderCapability::ChangeGeometries ) || vlayer->customProperty( QStringLiteral( "QFieldSync/is_geometry_locked" ), false ).toBool() ) return false; const bool geometryLockedExpressionActive = vlayer->customProperty( QStringLiteral( "QFieldSync/is_geometry_locked_expression_active" ), false ).toBool(); @@ -392,7 +392,7 @@ bool MultiFeatureListModelBase::canProcessSelection() const return false; QgsVectorLayer *vlayer = mSelectedFeatures[0].first; - if ( !vlayer || vlayer->readOnly() || !( vlayer->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeGeometries ) || vlayer->customProperty( QStringLiteral( "QFieldSync/is_geometry_locked" ), false ).toBool() ) + if ( !vlayer || vlayer->readOnly() || !( vlayer->dataProvider()->capabilities() & Qgis::VectorProviderCapability::ChangeGeometries ) || vlayer->customProperty( QStringLiteral( "QFieldSync/is_geometry_locked" ), false ).toBool() ) return false; const bool geometryLockedExpressionActive = vlayer->customProperty( QStringLiteral( "QFieldSync/is_geometry_locked_expression_active" ), false ).toBool(); diff --git a/vcpkg/ports/qgis/meshoptimizer.patch b/vcpkg/ports/qgis/meshoptimizer.patch index 7401ce3213..7d565ebfb9 100644 --- a/vcpkg/ports/qgis/meshoptimizer.patch +++ b/vcpkg/ports/qgis/meshoptimizer.patch @@ -1,60 +1,54 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index e299cb1d617..ae6482b4e90 100644 +index 49b44a30810..2c54551457d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -255,6 +255,7 @@ if(WITH_CORE) +@@ -31,6 +31,7 @@ set(SDK_PATH "" CACHE STRING "Build with VCPKG SDK") + if(NOT SDK_PATH STREQUAL "") + message(STATUS "Building with SDK -- ${SDK_PATH}") + set(CMAKE_TOOLCHAIN_FILE "${SDK_PATH}/scripts/buildsystems/vcpkg.cmake") ++ set(VCPKG_INSTALL_PREFIX "${SDK_PATH}/installed") + if(APPLE AND NOT VCPKG_TARGET_TRIPLET) + set(VCPKG_TARGET_TRIPLET "x64-osx-dynamic") + endif() +@@ -43,7 +44,7 @@ else() + endif() + + if(WITH_VCPKG) +- list(APPEND CMAKE_PROGRAM_PATH "${VCPKG_INSTALL_PREFIX}/${VCPKG_TARGET_TRIPLET}/") ++ list(APPEND CMAKE_PROGRAM_PATH "${VCPKG_INSTALL_PREFIX}/${VCPKG_TARGET_TRIPLET}/tools/python3/Scripts/") + set(PREFER_INTERNAL_LIBS FALSE) + else() + set(PREFER_INTERNAL_LIBS TRUE) +@@ -274,8 +275,8 @@ if(WITH_CORE) + endif() # try to configure and build POLY2TRI support - set (WITH_INTERNAL_POLY2TRI TRUE CACHE BOOL "Determines whether POLY2TRI should be built from internal copy") -+ set (WITH_INTERNAL_MESHOPTIMIZER TRUE CACHE BOOL "Determines whether MESHOPTIMIZER should be built from internal copy") +- set (WITH_INTERNAL_POLY2TRI PREFER_INTERNAL_LIBS CACHE BOOL "Determines whether POLY2TRI should be built from internal copy") +- set (WITH_INTERNAL_MESHOPTIMIZER PREFER_INTERNAL_LIBS CACHE BOOL "Determines whether MESHOPTIMIZER should be built from internal copy") ++ set (WITH_INTERNAL_POLY2TRI ${PREFER_INTERNAL_LIBS} CACHE BOOL "Determines whether POLY2TRI should be built from internal copy") ++ set (WITH_INTERNAL_MESHOPTIMIZER ${PREFER_INTERNAL_LIBS} CACHE BOOL "Determines whether MESHOPTIMIZER should be built from internal copy") # try to configure and build POSTGRESQL support set (WITH_POSTGRESQL TRUE CACHE BOOL "Determines whether POSTGRESQL support should be built") +@@ -388,7 +389,7 @@ if(WITH_CORE) + find_package(EXPAT REQUIRED) + find_package(Spatialindex REQUIRED) + find_package(LibZip REQUIRED) +- set (WITH_INTERNAL_NLOHMANN_JSON PREFER_INTERNAL_LIBS CACHE BOOL "Determines whether the vendored copy of nlohmann-json should be used") ++ set (WITH_INTERNAL_NLOHMANN_JSON ${PREFER_INTERNAL_LIBS} CACHE BOOL "Determines whether the vendored copy of nlohmann-json should be used") + find_package(nlohmann_json REQUIRED) + + # The following bypasses the FindSQLite3 module introduced in CMake 3.14 diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt -index 94c0e143001..777bd4bcb21 100644 +index 763de0f4968..808540650d2 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt -@@ -19,6 +19,18 @@ if (WITH_PDF4QT) - SUBDIRS(${CMAKE_SOURCE_DIR}/external/PDF4QT) +@@ -2350,7 +2350,7 @@ if(WITH_INTERNAL_MESHOPTIMIZER) + ) + else() + find_package(meshoptimizer CONFIG REQUIRED) +- target_link_libraries(qgis_core PRIVATE meshoptimizer::meshoptimizer) ++ target_link_libraries(qgis_core meshoptimizer::meshoptimizer) endif() -+if(WITH_INTERNAL_MESHOPTIMIZER) -+ add_library(STATIC meshoptimizer::meshoptimizer -+ ${CMAKE_SOURCE_DIR}/external/meshOptimizer/simplifier.cpp -+ ) -+ -+ target_include_directories(meshoptimizer::meshoptimizer -+ ${CMAKE_SOURCE_DIR}/external/meshOptimizer -+ ) -+else() -+ find_package(meshoptimizer CONFIG REQUIRED) -+endif() -+ - set(QGIS_CORE_SRCS - ${CMAKE_SOURCE_DIR}/external/kdbush/include/kdbush.hpp - -@@ -30,8 +42,6 @@ set(QGIS_CORE_SRCS - ${CMAKE_SOURCE_DIR}/external/nmea/time.c - ${CMAKE_SOURCE_DIR}/external/nmea/tok.c - -- ${CMAKE_SOURCE_DIR}/external/meshOptimizer/simplifier.cpp -- - ${FLEX_QgsExpressionLexer_OUTPUTS} - ${BISON_QgsExpressionParser_OUTPUTS} - ${FLEX_QgsSqlStatementLexer_OUTPUTS} -@@ -2375,7 +2385,6 @@ target_include_directories(qgis_core PUBLIC - ${CMAKE_SOURCE_DIR}/external/kdbush/include - ${CMAKE_SOURCE_DIR}/external/nmea - ${CMAKE_SOURCE_DIR}/external/rtree/include -- ${CMAKE_SOURCE_DIR}/external/meshOptimizer - ${CMAKE_SOURCE_DIR}/external/tinygltf - ) - -@@ -2485,6 +2494,7 @@ target_link_libraries(qgis_core - ${ZLIB_LIBRARIES} - ${EXIV2_LIBRARY} - PROJ::proj -+ meshoptimizer::meshoptimizer - ) - - if(BUILD_WITH_QT6) + # require c++17 diff --git a/vcpkg/ports/qgis/portfile.cmake b/vcpkg/ports/qgis/portfile.cmake index af4cba1d26..e4310bc36e 100644 --- a/vcpkg/ports/qgis/portfile.cmake +++ b/vcpkg/ports/qgis/portfile.cmake @@ -1,5 +1,5 @@ -set(QGIS_REF c12f44e6235e7253963ceb65e36a338e927ae499) -set(QGIS_SHA512 1fb39ff4f40de9a08e79ae73593afa324c7bfa07be34c255599cc17fe7206c24a42573aa21bfb8ec9d422bbe645b5e62938d4549f940c57275ba98be1e5888aa) +set(QGIS_REF final-3_40_0) +set(QGIS_SHA512 2c7348790748b979cdda280e60649ad64de232b0894f1310f4558b19e20ba834f832e92e814cb94b2b089406c2448013def5b3cbd932b8e2892a2b7570721764) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -13,12 +13,10 @@ vcpkg_from_github( exiv2.patch bigobj.patch mesh.patch - wrongattributeerrormessage.patch crssync-no-install.patch include-qthread.patch processing.patch # Needed to avoid link issue with tinygltf (ATM embedded into QGIS) and _GEOSQueryCallback defined multiple times - font_download.patch - meshoptimizer.patch # Unvendor meshoptimizer + meshoptimizer.patch ) file(REMOVE ${SOURCE_PATH}/cmake/FindGDAL.cmake) @@ -40,6 +38,7 @@ list(APPEND QGIS_OPTIONS "-DWITH_PDAL:BOOL=OFF") list(APPEND QGIS_OPTIONS "-DWITH_DRACO:BOOL=ON") list(APPEND QGIS_OPTIONS "-DWITH_INTERNAL_POLY2TRI:BOOL=OFF") list(APPEND QGIS_OPTIONS "-DWITH_INTERNAL_MESHOPTIMIZER:BOOL=OFF") +list(APPEND QGIS_OPTIONS "-DPREFER_INTERNAL_LIBS:BOOL=OFF") list(APPEND QGIS_OPTIONS "-DBISON_EXECUTABLE=${BISON}") list(APPEND QGIS_OPTIONS "-DFLEX_EXECUTABLE=${FLEX}") diff --git a/vcpkg/ports/qgis/processing.patch b/vcpkg/ports/qgis/processing.patch index 420819c693..a1a58c77f9 100644 --- a/vcpkg/ports/qgis/processing.patch +++ b/vcpkg/ports/qgis/processing.patch @@ -1,5 +1,5 @@ diff --git a/src/analysis/processing/qgsnativealgorithms.cpp b/src/analysis/processing/qgsnativealgorithms.cpp -index 06a26910024..5a32a96cb86 100644 +index a74cdfc700b..2b2412c933a 100644 --- a/src/analysis/processing/qgsnativealgorithms.cpp +++ b/src/analysis/processing/qgsnativealgorithms.cpp @@ -31,7 +31,6 @@ @@ -7,10 +7,10 @@ index 06a26910024..5a32a96cb86 100644 #include "qgsalgorithmassignprojection.h" #include "qgsalgorithmattributeindex.h" -#include "qgsalgorithmb3dmtogltf.h" + #include "qgsalgorithmbasicstatistics.h" #include "qgsalgorithmbatchnominatimgeocode.h" #include "qgsalgorithmboundary.h" - #include "qgsalgorithmboundingbox.h" -@@ -99,7 +98,6 @@ +@@ -100,7 +99,6 @@ #include "qgsalgorithmforcerhr.h" #include "qgsalgorithmfuzzifyraster.h" #include "qgsalgorithmgeometrybyexpression.h" @@ -18,7 +18,7 @@ index 06a26910024..5a32a96cb86 100644 #if QT_CONFIG(process) #include "qgsalgorithmgpsbabeltools.h" #endif -@@ -203,7 +201,6 @@ +@@ -204,7 +202,6 @@ #include "qgsalgorithmsinglesidedbuffer.h" #include "qgsalgorithmslope.h" #include "qgsalgorithmsmooth.h" @@ -26,15 +26,15 @@ index 06a26910024..5a32a96cb86 100644 #include "qgsalgorithmsnaptogrid.h" #include "qgsalgorithmspatialindex.h" #include "qgsalgorithmsplitfeaturesbyattributecharacter.h" -@@ -297,7 +294,6 @@ void QgsNativeAlgorithms::loadAlgorithms() +@@ -300,7 +297,6 @@ void QgsNativeAlgorithms::loadAlgorithms() addAlgorithm( new QgsAspectAlgorithm() ); addAlgorithm( new QgsAssignProjectionAlgorithm() ); addAlgorithm( new QgsAttributeIndexAlgorithm() ); - addAlgorithm( new QgsB3DMToGltfAlgorithm() ); + addAlgorithm( new QgsBasicStatisticsAlgorithm() ); addAlgorithm( new QgsBatchNominatimGeocodeAlgorithm() ); addAlgorithm( new QgsBookmarksToLayerAlgorithm() ); - addAlgorithm( new QgsBoundaryAlgorithm() ); -@@ -380,7 +376,6 @@ void QgsNativeAlgorithms::loadAlgorithms() +@@ -384,7 +380,6 @@ void QgsNativeAlgorithms::loadAlgorithms() addAlgorithm( new QgsFuzzifyRasterGaussianMembershipAlgorithm() ); addAlgorithm( new QgsFuzzifyRasterNearMembershipAlgorithm() ); addAlgorithm( new QgsGeometryByExpressionAlgorithm() ); @@ -42,7 +42,7 @@ index 06a26910024..5a32a96cb86 100644 #if QT_CONFIG(process) addAlgorithm( new QgsConvertGpxFeatureTypeAlgorithm() ); addAlgorithm( new QgsConvertGpsDataAlgorithm() ); -@@ -515,7 +510,6 @@ void QgsNativeAlgorithms::loadAlgorithms() +@@ -519,7 +514,6 @@ void QgsNativeAlgorithms::loadAlgorithms() addAlgorithm( new QgsSingleSidedBufferAlgorithm() ); addAlgorithm( new QgsSlopeAlgorithm() ); addAlgorithm( new QgsSmoothAlgorithm() );