From d0e26fb3bca2d984625e74cc38b1ea872ddd6107 Mon Sep 17 00:00:00 2001 From: Julien Cabieces Date: Wed, 30 Oct 2019 10:55:37 +0100 Subject: [PATCH] Extract loc->isindexing from indexprepared --- src/core/qgssnappingutils.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/core/qgssnappingutils.cpp b/src/core/qgssnappingutils.cpp index 7930410a50e..ef1eae00390 100644 --- a/src/core/qgssnappingutils.cpp +++ b/src/core/qgssnappingutils.cpp @@ -68,7 +68,7 @@ QgsPointLocator *QgsSnappingUtils::locatorForLayerUsingStrategy( QgsVectorLayer QgsPointLocator *loc = locatorForLayer( vl ); - if ( isIndexPrepared( loc, aoi ) ) + if ( loc->isIndexing() || isIndexPrepared( loc, aoi ) ) return loc; else return temporaryLocatorForLayer( vl, pointMap, tolerance ); @@ -91,9 +91,6 @@ QgsPointLocator *QgsSnappingUtils::temporaryLocatorForLayer( QgsVectorLayer *vl, bool QgsSnappingUtils::isIndexPrepared( QgsPointLocator *loc, const QgsRectangle &areaOfInterest ) { - if ( loc->isIndexing() ) - return true; - if ( mStrategy == IndexAlwaysFull && loc->hasIndex() ) return true; @@ -374,7 +371,7 @@ void QgsSnappingUtils::prepareIndex( const QList &layers QgsPointLocator *loc = locatorForLayer( vl ); - if ( !isIndexPrepared( loc, entry.second ) ) + if ( !loc->isIndexing() && !isIndexPrepared( loc, entry.second ) ) layersToIndex << entry; } if ( !layersToIndex.isEmpty() )