Skip to content

Commit

Permalink
[Geometry checker] Fix result table corruption when adding newly foun…
Browse files Browse the repository at this point in the history
…d errors
  • Loading branch information
manisandro committed Jul 14, 2016
1 parent a8c35a9 commit 3e28b9a
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 )
Expand Down

0 comments on commit 3e28b9a

Please sign in to comment.