@@ -52,6 +52,10 @@ void QgsGeometryValidationService::onLayersAdded( const QList<QgsMapLayer *> &la
52
52
{
53
53
onFeatureDeleted ( vectorLayer, fid );
54
54
} );
55
+ connect ( vectorLayer, &QgsVectorLayer::beforeCommitChanges, this , [this , vectorLayer]()
56
+ {
57
+ onBeforeCommitChanges ( vectorLayer );
58
+ } );
55
59
56
60
enableLayerChecks ( vectorLayer );
57
61
}
@@ -76,6 +80,14 @@ void QgsGeometryValidationService::onFeatureDeleted( QgsVectorLayer *layer, QgsF
76
80
cancelChecks ( layer, fid );
77
81
}
78
82
83
+ void QgsGeometryValidationService::onBeforeCommitChanges ( QgsVectorLayer *layer )
84
+ {
85
+ if ( !mTopologyChecksOk .value ( layer ) )
86
+ {
87
+ triggerTopologyChecks ( layer );
88
+ }
89
+ }
90
+
79
91
void QgsGeometryValidationService::enableLayerChecks ( QgsVectorLayer *layer )
80
92
{
81
93
// TODO: finish all ongoing checks
@@ -145,7 +157,9 @@ void QgsGeometryValidationService::processFeature( QgsVectorLayer *layer, QgsFea
145
157
}
146
158
147
159
emit geometryCheckCompleted ( layer, fid, allErrors );
148
- // TODO: this is a bit hardcore
149
- // const auto errors = mIsValidGeometryCheck->processGeometry( feature.geometry() );
150
- // emit geometryCheckCompleted( layer, fid, errors );
160
+ }
161
+
162
+ void QgsGeometryValidationService::triggerTopologyChecks ( QgsVectorLayer *layer )
163
+ {
164
+
151
165
}
0 commit comments