Skip to content

Commit

Permalink
Fix the selected error
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 15, 2018
1 parent e65f6b4 commit 35d7fdc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/app/qgsgeometryvalidationdock.cpp
Expand Up @@ -173,11 +173,16 @@ void QgsGeometryValidationDock::onCurrentErrorChanged( const QModelIndex &curren
mPreviousButton->setEnabled( current.isValid() && current.row() > 0 );

mProblemDetailWidget->setVisible( current.isValid() );

if ( !current.isValid() )
return;

mProblemDescriptionLabel->setText( current.data( QgsGeometryValidationModel::DetailsRole ).toString() );

QgsGeometryCheckError *error = current.data( QgsGeometryValidationModel::GeometryCheckErrorRole ).value<QgsGeometryCheckError *>();
if ( error )
{
delete mResolutionWidget->layout();
const QStringList resolutionMethods = error->check()->resolutionMethods();
QGridLayout *layout = new QGridLayout( mResolutionWidget );
int resolutionIndex = 0;
Expand Down
3 changes: 2 additions & 1 deletion src/app/qgsgeometryvalidationmodel.cpp
Expand Up @@ -333,7 +333,8 @@ void QgsGeometryValidationModel::onTopologyErrorUpdated( QgsVectorLayer *layer,
if ( layer == mCurrentLayer )
{
int i = 0;
for ( const auto &currentError : qgis::as_const( mTopologyErrorStorage[layer] ) )
const auto &errors = mTopologyErrorStorage[layer];
for ( const auto &currentError : errors )
{
if ( currentError.get() == error )
{
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgsgeometryvalidationservice.cpp
Expand Up @@ -66,6 +66,8 @@ void QgsGeometryValidationService::fixError( QgsGeometryCheckError *error, int m
}
}

layer->triggerRepaint();

emit topologyErrorUpdated( layer, error );
}

Expand Down

0 comments on commit 35d7fdc

Please sign in to comment.