mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-22 00:06:57 -04:00
Save layer changes on successful repair
when there are topology errors which are fixed subsequently, make sure that the layer can be saved again
This commit is contained in:
parent
cafa652c02
commit
9e0b9e76e2
@ -145,7 +145,7 @@ void QgsGeometryValidationService::onFeatureDeleted( QgsVectorLayer *layer, QgsF
|
||||
|
||||
void QgsGeometryValidationService::onBeforeCommitChanges( QgsVectorLayer *layer )
|
||||
{
|
||||
if ( !mLayerChecks[layer].topologyChecks.empty() ) // TODO && topologyChecks not fulfilled
|
||||
if ( !mBypassChecks && !mLayerChecks[layer].topologyChecks.empty() )
|
||||
{
|
||||
if ( !layer->allowCommit() )
|
||||
{
|
||||
@ -461,7 +461,9 @@ void QgsGeometryValidationService::triggerTopologyChecks( QgsVectorLayer *layer
|
||||
}
|
||||
if ( allErrors.empty() && mLayerChecks[layer].singleFeatureCheckErrors.empty() && mLayerChecks[layer].commitPending )
|
||||
{
|
||||
mBypassChecks = true;
|
||||
layer->commitChanges();
|
||||
mBypassChecks = false;
|
||||
mMessageBar->popWidget( mMessageBarItem );
|
||||
mMessageBarItem = nullptr;
|
||||
}
|
||||
|
@ -122,6 +122,10 @@ class QgsGeometryValidationService : public QObject
|
||||
QgsMessageBar *mMessageBar = nullptr;
|
||||
QgsMessageBarItem *mMessageBarItem = nullptr;
|
||||
|
||||
// when checks do complete successfully and changes need to be saved
|
||||
// this variable is used to indicate that it's safe to bypass the checks
|
||||
bool mBypassChecks = false;
|
||||
|
||||
};
|
||||
|
||||
#endif // QGSGEOMETRYVALIDATIONSERVICE_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user