Skip to content

Commit 49b66a5

Browse files
authored
Merge pull request #9577 from m-kuhn/geometry_validation_invalid_feature_zoom_to_problem_problem
Only change map extent when manually changing the active error
2 parents ef4a578 + fa15e72 commit 49b66a5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/app/qgsgeometryvalidationdock.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ void QgsGeometryValidationDock::setGeometryValidationModel( QgsGeometryValidatio
8484
mErrorListView->setModel( mGeometryValidationModel );
8585

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

243244
bool hasFeature = !FID_IS_NULL( current.data( QgsGeometryValidationModel::ErrorFeatureIdRole ) );
244245
mZoomToFeatureButton->setEnabled( hasFeature );
246+
}
245247

248+
void QgsGeometryValidationDock::updateMapCanvasExtent()
249+
{
246250
if ( !mPreventZoomToError )
247251
{
248252
switch ( mLastZoomToAction )

src/app/qgsgeometryvalidationdock.h

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class QgsGeometryValidationDock : public QgsDockWidget, public Ui_QgsGeometryVal
4646
private slots:
4747
void updateCurrentError();
4848
void onCurrentErrorChanged( const QModelIndex &current, const QModelIndex &previous );
49+
void updateMapCanvasExtent();
4950
void onCurrentLayerChanged( QgsMapLayer *layer );
5051
void onLayerDestroyed( QObject *layer );
5152
void gotoNextError();

0 commit comments

Comments
 (0)