Skip to content

Commit

Permalink
Merge pull request #8701 from m-kuhn/fixSingleLayerErrorsBackport
Browse files Browse the repository at this point in the history
Allow saving a layer after fixing invalid geometries
  • Loading branch information
m-kuhn authored Dec 18, 2018
2 parents 28f3123 + f8fb565 commit 498d51e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/qgsgeometryvalidationservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ void QgsGeometryValidationService::onFeatureDeleted( QgsVectorLayer *layer, QgsF

void QgsGeometryValidationService::onBeforeCommitChanges( QgsVectorLayer *layer )
{
if ( mLayerChecks[layer].topologyChecks.empty() && !layer->allowCommit() )
{
showMessage( tr( "Geometry errors have been found. Please fix the errors before saving the layer." ) );
}
if ( !mBypassChecks && !mLayerChecks[layer].topologyChecks.empty() )
{
if ( !layer->allowCommit() )
Expand Down Expand Up @@ -359,6 +363,8 @@ void QgsGeometryValidationService::processFeature( QgsVectorLayer *layer, QgsFea

if ( !mLayerChecks[layer].singleFeatureCheckErrors.empty() )
layer->setAllowCommit( false );
else if ( mLayerChecks[layer].topologyChecks.empty() )
layer->setAllowCommit( true );

emit geometryCheckCompleted( layer, fid, allErrors );
}
Expand Down

0 comments on commit 498d51e

Please sign in to comment.