Skip to content
Permalink
Browse files

[Geometry checker] Fix result table corruption when adding newly foun…

…d errors
  • Loading branch information
manisandro committed Jul 14, 2016
1 parent a8c35a9 commit 3e28b9ae3921b3292403a11d2470f4a9198cc020
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/plugins/geometry_checker/ui/qgsgeometrycheckerresulttab.cpp
@@ -110,6 +110,10 @@ void QgsGeometryCheckerResultTab::finalize()

void QgsGeometryCheckerResultTab::addError( QgsGeometryCheckError *error )
{
bool sortingWasEnabled = ui.tableWidgetErrors->isSortingEnabled();
if ( sortingWasEnabled )
ui.tableWidgetErrors->setSortingEnabled( false );

int row = ui.tableWidgetErrors->rowCount();
int prec = 7 - std::floor( qMax( 0., std::log10( qMax( error->location().x(), error->location().y() ) ) ) );
QString posStr = QString( "%1, %2" ).arg( error->location().x(), 0, 'f', prec ).arg( error->location().y(), 0, 'f', prec );
@@ -142,6 +146,9 @@ void QgsGeometryCheckerResultTab::addError( QgsGeometryCheckError *error )
ui.labelErrorCount->setText( tr( "Total errors: %1, fixed errors: %2" ).arg( mErrorCount ).arg( mFixedCount ) );
mStatistics.newErrors.insert( error );
mErrorMap.insert( error, QPersistentModelIndex( ui.tableWidgetErrors->model()->index( row, 0 ) ) );

if ( sortingWasEnabled )
ui.tableWidgetErrors->setSortingEnabled( true );
}

void QgsGeometryCheckerResultTab::updateError( QgsGeometryCheckError *error, bool statusChanged )

0 comments on commit 3e28b9a

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