Skip to content
Permalink
Browse files

[Geometry checker] Enter update mode when editing result layers

  • Loading branch information
manisandro committed Sep 25, 2017
1 parent bd8028e commit 156f0060c6bbd935ff31231c4997c2ee60d9097d
@@ -33,6 +33,15 @@ QgsGeometryChecker::QgsGeometryChecker( const QList<QgsGeometryCheck *> &checks,
{
connect( mContext->featurePools[layerId], SIGNAL( featureIdsChanged( QString, QMap<QgsFeatureId, QgsFeatureId> ) ), this, SLOT( updateFeatureIds( QString, QMap<QgsFeatureId, QgsFeatureId> ) ) );
}
for ( const QgsFeaturePool *featurePool : mContext->featurePools.values() )
{
if ( featurePool->getLayer() )
{
featurePool->getLayer()->setReadOnly( true );
// Enter update mode to defer ogr dataset repacking until the checker has finished
featurePool->getLayer()->dataProvider()->enterUpdateMode();
}
}
}

QgsGeometryChecker::~QgsGeometryChecker()
@@ -42,7 +51,10 @@ QgsGeometryChecker::~QgsGeometryChecker()
for ( const QgsFeaturePool *featurePool : mContext->featurePools.values() )
{
if ( featurePool->getLayer() )
{
featurePool->getLayer()->dataProvider()->leaveUpdateMode();
featurePool->getLayer()->setReadOnly( false );
}
delete featurePool;
}
delete mContext;
@@ -449,11 +449,6 @@ void QgsGeometryCheckerSetupTab::runChecks()

emit checkerStarted( checker );

// Add result layer (do this after checkerStarted, otherwise warning about removing of result layer may appear)
for ( QgsVectorLayer *layer : processLayers )
{
layer->setReadOnly( true );
}
if ( ui.radioButtonOutputNew->isChecked() )
{
QList<QgsMapLayer *> addLayers;

0 comments on commit 156f006

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