Skip to content
Permalink
Browse files

Merge pull request #9577 from m-kuhn/geometry_validation_invalid_feat…

…ure_zoom_to_problem_problem

Only change map extent when manually changing the active error
  • Loading branch information
m-kuhn committed Mar 21, 2019
2 parents ef4a578 + fa15e72 commit 49b66a549c037c59b7486c60ebacbcfa795b39f0
Showing with 5 additions and 0 deletions.
  1. +4 −0 src/app/qgsgeometryvalidationdock.cpp
  2. +1 −0 src/app/qgsgeometryvalidationdock.h
@@ -84,6 +84,7 @@ void QgsGeometryValidationDock::setGeometryValidationModel( QgsGeometryValidatio
mErrorListView->setModel( mGeometryValidationModel );

connect( mErrorListView->selectionModel(), &QItemSelectionModel::currentChanged, this, &QgsGeometryValidationDock::onCurrentErrorChanged );
connect( mErrorListView->selectionModel(), &QItemSelectionModel::currentChanged, this, [this]() { updateMapCanvasExtent(); } );
connect( mGeometryValidationModel, &QgsGeometryValidationModel::dataChanged, this, &QgsGeometryValidationDock::onDataChanged );
connect( mGeometryValidationModel, &QgsGeometryValidationModel::rowsRemoved, this, &QgsGeometryValidationDock::updateCurrentError );
connect( mGeometryValidationModel, &QgsGeometryValidationModel::rowsInserted, this, &QgsGeometryValidationDock::onRowsInserted );
@@ -242,7 +243,10 @@ void QgsGeometryValidationDock::onCurrentErrorChanged( const QModelIndex &curren

bool hasFeature = !FID_IS_NULL( current.data( QgsGeometryValidationModel::ErrorFeatureIdRole ) );
mZoomToFeatureButton->setEnabled( hasFeature );
}

void QgsGeometryValidationDock::updateMapCanvasExtent()
{
if ( !mPreventZoomToError )
{
switch ( mLastZoomToAction )
@@ -46,6 +46,7 @@ class QgsGeometryValidationDock : public QgsDockWidget, public Ui_QgsGeometryVal
private slots:
void updateCurrentError();
void onCurrentErrorChanged( const QModelIndex &current, const QModelIndex &previous );
void updateMapCanvasExtent();
void onCurrentLayerChanged( QgsMapLayer *layer );
void onLayerDestroyed( QObject *layer );
void gotoNextError();

0 comments on commit 49b66a5

Please sign in to comment.
You can’t perform that action at this time.