Skip to content

Commit

Permalink
Remove unneeded code
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Mar 18, 2019
1 parent 5f4308c commit 6bcba42
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
24 changes: 0 additions & 24 deletions src/app/qgsgeometryvalidationdock.cpp
Expand Up @@ -265,39 +265,15 @@ void QgsGeometryValidationDock::onCurrentLayerChanged( QgsMapLayer *layer )

if ( mCurrentLayer )
{
disconnect( mCurrentLayer, &QgsVectorLayer::editingStarted, this, &QgsGeometryValidationDock::onLayerEditingStatusChanged );
disconnect( mCurrentLayer, &QgsVectorLayer::editingStopped, this, &QgsGeometryValidationDock::onLayerEditingStatusChanged );
disconnect( mCurrentLayer, &QgsVectorLayer::destroyed, this, &QgsGeometryValidationDock::onLayerDestroyed );
}

mCurrentLayer = qobject_cast<QgsVectorLayer *>( layer );

if ( mCurrentLayer )
{
connect( mCurrentLayer, &QgsVectorLayer::editingStarted, this, &QgsGeometryValidationDock::onLayerEditingStatusChanged );
connect( mCurrentLayer, &QgsVectorLayer::editingStopped, this, &QgsGeometryValidationDock::onLayerEditingStatusChanged );
connect( mCurrentLayer, &QgsVectorLayer::destroyed, this, &QgsGeometryValidationDock::onLayerDestroyed );
}

onLayerEditingStatusChanged();
}

void QgsGeometryValidationDock::onLayerEditingStatusChanged()
{
bool enabled = false;
if ( mCurrentLayer && mCurrentLayer->isSpatial() && mCurrentLayer->isEditable() )
{
const QList<QgsGeometryCheckFactory *> topologyCheckFactories = QgsAnalysis::instance()->geometryCheckRegistry()->geometryCheckFactories( mCurrentLayer, QgsGeometryCheck::LayerCheck, QgsGeometryCheck::Flag::AvailableInValidation );
const QStringList activeChecks = mCurrentLayer->geometryOptions()->geometryChecks();
for ( const QgsGeometryCheckFactory *factory : topologyCheckFactories )
{
if ( activeChecks.contains( factory->id() ) )
{
enabled = true;
break;
}
}
}
}

void QgsGeometryValidationDock::onLayerDestroyed( QObject *layer )
Expand Down
1 change: 0 additions & 1 deletion src/app/qgsgeometryvalidationdock.h
Expand Up @@ -47,7 +47,6 @@ class QgsGeometryValidationDock : public QgsDockWidget, public Ui_QgsGeometryVal
void updateCurrentError();
void onCurrentErrorChanged( const QModelIndex &current, const QModelIndex &previous );
void onCurrentLayerChanged( QgsMapLayer *layer );
void onLayerEditingStatusChanged();
void onLayerDestroyed( QObject *layer );
void gotoNextError();
void gotoPreviousError();
Expand Down

0 comments on commit 6bcba42

Please sign in to comment.