@@ -265,39 +265,15 @@ void QgsGeometryValidationDock::onCurrentLayerChanged( QgsMapLayer *layer )
265
265
266
266
if ( mCurrentLayer )
267
267
{
268
- disconnect ( mCurrentLayer , &QgsVectorLayer::editingStarted, this , &QgsGeometryValidationDock::onLayerEditingStatusChanged );
269
- disconnect ( mCurrentLayer , &QgsVectorLayer::editingStopped, this , &QgsGeometryValidationDock::onLayerEditingStatusChanged );
270
268
disconnect ( mCurrentLayer , &QgsVectorLayer::destroyed, this , &QgsGeometryValidationDock::onLayerDestroyed );
271
269
}
272
270
273
271
mCurrentLayer = qobject_cast<QgsVectorLayer *>( layer );
274
272
275
273
if ( mCurrentLayer )
276
274
{
277
- connect ( mCurrentLayer , &QgsVectorLayer::editingStarted, this , &QgsGeometryValidationDock::onLayerEditingStatusChanged );
278
- connect ( mCurrentLayer , &QgsVectorLayer::editingStopped, this , &QgsGeometryValidationDock::onLayerEditingStatusChanged );
279
275
connect ( mCurrentLayer , &QgsVectorLayer::destroyed, this , &QgsGeometryValidationDock::onLayerDestroyed );
280
276
}
281
-
282
- onLayerEditingStatusChanged ();
283
- }
284
-
285
- void QgsGeometryValidationDock::onLayerEditingStatusChanged ()
286
- {
287
- bool enabled = false ;
288
- if ( mCurrentLayer && mCurrentLayer ->isSpatial () && mCurrentLayer ->isEditable () )
289
- {
290
- const QList<QgsGeometryCheckFactory *> topologyCheckFactories = QgsAnalysis::instance ()->geometryCheckRegistry ()->geometryCheckFactories ( mCurrentLayer , QgsGeometryCheck::LayerCheck, QgsGeometryCheck::Flag::AvailableInValidation );
291
- const QStringList activeChecks = mCurrentLayer ->geometryOptions ()->geometryChecks ();
292
- for ( const QgsGeometryCheckFactory *factory : topologyCheckFactories )
293
- {
294
- if ( activeChecks.contains ( factory->id () ) )
295
- {
296
- enabled = true ;
297
- break ;
298
- }
299
- }
300
- }
301
277
}
302
278
303
279
void QgsGeometryValidationDock::onLayerDestroyed ( QObject *layer )
0 commit comments