Skip to content
Permalink
Browse files

Merge pull request #8403 from m-kuhn/backportAutoActivateGeometryVali…

…dation

Backport auto activate geometry validation
  • Loading branch information
m-kuhn committed Nov 2, 2018
2 parents 383851c + 63d9421 commit 7b5926fb9e4949b830a9872581112bdbefa967a4
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/app/qgsgeometryvalidationservice.cpp
@@ -88,6 +88,11 @@ void QgsGeometryValidationService::onLayersAdded( const QList<QgsMapLayer *> &la
enableLayerChecks( vectorLayer );
} );

connect( vectorLayer->geometryOptions(), &QgsGeometryOptions::geometryChecksChanged, this, [this, vectorLayer]()
{
enableLayerChecks( vectorLayer );
} );

connect( vectorLayer, &QgsVectorLayer::destroyed, this, [vectorLayer, this]()
{
cleanupLayerChecks( vectorLayer );
@@ -175,9 +180,12 @@ void QgsGeometryValidationService::cleanupLayerChecks( QgsVectorLayer *layer )
VectorLayerCheckInformation &checkInformation = mLayerChecks[layer];

cancelTopologyCheck( layer );
clearTopologyChecks( layer );

qDeleteAll( checkInformation.singleFeatureChecks );
checkInformation.singleFeatureChecks.clear();
qDeleteAll( checkInformation.topologyChecks );
checkInformation.topologyChecks.clear();
checkInformation.context.reset();
}

@@ -315,6 +323,7 @@ void QgsGeometryValidationService::clearTopologyChecks( QgsVectorLayer *layer )
{
QList<std::shared_ptr<QgsGeometryCheckError>> &allErrors = mLayerChecks[layer].topologyCheckErrors;
allErrors.clear();
layer->setAllowCommit( mLayerChecks[layer].singleFeatureCheckErrors.empty() );

emit topologyChecksCleared( layer );
}
@@ -363,6 +372,7 @@ void QgsGeometryValidationService::triggerTopologyChecks( QgsVectorLayer *layer
{
cancelTopologyCheck( layer );
clearTopologyChecks( layer );
layer->setAllowCommit( false );

QgsFeatureIds affectedFeatureIds;
if ( layer->editBuffer() )

0 comments on commit 7b5926f

Please sign in to comment.
You can’t perform that action at this time.