Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[Geometry checker] Enter update mode when editing result layers
- Loading branch information
|
@@ -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; |
|
|