Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update QGIS to 3.40.0 final #5774

Merged
merged 2 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/digitizinglogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void DigitizingLogger::findLogsLayer()
if ( item )
{
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( 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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/layertreemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ QVariant FlatLayerTreeModelBase::data( const QModelIndex &index, int role ) cons
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( nodeLayer->layer() );

if ( layer && layer->dataProvider() )
return static_cast<bool>( layer->dataProvider()->capabilities() & QgsVectorDataProvider::Capability::ReloadData );
return static_cast<bool>( layer->dataProvider()->capabilities() & Qgis::VectorProviderCapability::ReloadData );
}

return false;
Expand Down
16 changes: 8 additions & 8 deletions src/core/multifeaturelistmodelbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
88 changes: 41 additions & 47 deletions vcpkg/ports/qgis/meshoptimizer.patch
Original file line number Diff line number Diff line change
@@ -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
9 changes: 4 additions & 5 deletions vcpkg/ports/qgis/portfile.cmake
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand All @@ -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}")
Expand Down
16 changes: 8 additions & 8 deletions vcpkg/ports/qgis/processing.patch
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
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 @@
#include "qgsalgorithmaspect.h"
#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"
-#include "qgsalgorithmgltftovector.h"
#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"
-#include "qgsalgorithmsnapgeometries.h"
#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() );
- addAlgorithm( new QgsGltfToVectorFeaturesAlgorithm() );
#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() );
Expand Down
Loading