Skip to content

Commit

Permalink
Only change map extent when manually changing the active error
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Mar 20, 2019
1 parent 1e8aec4 commit e4d5af6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/qgsgeometryvalidationdock.cpp
Expand Up @@ -85,6 +85,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 );
Expand Down Expand Up @@ -243,7 +244,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 )
Expand Down
1 change: 1 addition & 0 deletions src/app/qgsgeometryvalidationdock.h
Expand Up @@ -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 onLayerEditingStatusChanged();
void onLayerDestroyed( QObject *layer );
Expand Down

0 comments on commit e4d5af6

Please sign in to comment.