Skip to content

Commit

Permalink
One feature pool per layer is enough
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 15, 2018
1 parent 6df73d6 commit 09ee755
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/app/qgsgeometryvalidationservice.cpp
Expand Up @@ -259,8 +259,13 @@ void QgsGeometryValidationService::triggerTopologyChecks( QgsVectorLayer *layer
QgsFeatureIds affectedFeatureIds = layer->editBuffer()->changedGeometries().keys().toSet();
affectedFeatureIds.unite( layer->editBuffer()->addedFeatures().keys().toSet() );

// TODO: ownership of these objects...
QgsVectorLayerFeaturePool *featurePool = new QgsVectorLayerFeaturePool( layer );
QgsFeaturePool *featurePool = mFeaturePools.value( layer->id() );
if ( !featurePool )
{
featurePool = new QgsVectorLayerFeaturePool( layer );
mFeaturePools.insert( layer->id(), featurePool );
}

QList<QgsGeometryCheckError *> &allErrors = mLayerChecks[layer].topologyCheckErrors;
QMap<QString, QgsFeatureIds> layerIds;

Expand All @@ -279,11 +284,6 @@ void QgsGeometryValidationService::triggerTopologyChecks( QgsVectorLayer *layer
layerIds.insert( layer->id(), checkFeatureIds );
QgsGeometryCheck::LayerFeatureIds layerFeatureIds( layerIds );

if ( !mFeaturePools.contains( layer->id() ) )
{
mFeaturePools.insert( layer->id(), featurePool );
}

const QList<QgsGeometryCheck *> checks = mLayerChecks[layer].topologyChecks;

QMap<const QgsGeometryCheck *, QgsFeedback *> feedbacks;
Expand Down

0 comments on commit 09ee755

Please sign in to comment.