Skip to content

Commit

Permalink
[Geometry checker] Trigger repaint instead of explicit refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Jul 14, 2016
1 parent 332e1d4 commit f2f93d6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/plugins/geometry_checker/qgsgeometrychecker.cpp
Expand Up @@ -240,6 +240,11 @@ bool QgsGeometryChecker::fixError( QgsGeometryCheckError* error, int method )
return true;
}

QgsMapLayer* QgsGeometryChecker::getLayer() const
{
return mFeaturePool->getLayer();
}

void QgsGeometryChecker::runCheck( const QgsGeometryCheck* check )
{
// Run checks
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/geometry_checker/qgsgeometrychecker.h
Expand Up @@ -27,6 +27,7 @@ typedef QSet<QgsFeatureId> QgsFeatureIds;
class QgsFeaturePool;
class QgsGeometryCheck;
class QgsGeometryCheckError;
class QgsMapLayer;
class QgsVectorLayer;
class QMutex;

Expand All @@ -38,6 +39,7 @@ class QgsGeometryChecker : public QObject
~QgsGeometryChecker();
QFuture<void> execute( int* totalSteps = nullptr );
bool fixError( QgsGeometryCheckError *error, int method );
QgsMapLayer* getLayer() const;
const QList<QgsGeometryCheck*> getChecks() const { return mChecks; }
const QStringList& getMessages() const { return mMessages; }

Expand Down
Expand Up @@ -391,7 +391,6 @@ void QgsGeometryCheckerResultTab::highlightErrors( bool current )
}

mIface->mapCanvas()->setExtent( totextent );
mIface->mapCanvas()->refresh();
}

void QgsGeometryCheckerResultTab::onSelectionChanged( const QItemSelection &newSel, const QItemSelection &/*oldSel*/ )
Expand Down Expand Up @@ -502,8 +501,7 @@ void QgsGeometryCheckerResultTab::fixErrors( bool prompt )
ui.progressBarFixErrors->setVisible( false );
unsetCursor();
}

mIface->mapCanvas()->refresh();
mChecker->getLayer()->triggerRepaint();

if ( mStatistics.itemCount() > 0 )
{
Expand Down
Expand Up @@ -125,6 +125,7 @@ void QgsGeometryCheckerFixDialog::fixError()

QgsGeometryCheckError* error = mErrors.at( 0 );
mChecker->fixError( error, mRadioGroup->checkedId() );
mChecker->getLayer()->triggerRepaint();

unsetCursor();

Expand Down Expand Up @@ -165,7 +166,6 @@ void QgsGeometryCheckerFixDialog::fixError()
}
adjustSize();
emit currentErrorChanged( error );
mIface->mapCanvas()->refresh();
}

void QgsGeometryCheckerFixDialog::skipError()
Expand Down

0 comments on commit f2f93d6

Please sign in to comment.