mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-12 00:02:25 -04:00
Extract loc->isindexing from indexprepared
This commit is contained in:
parent
d246d9f593
commit
d0e26fb3bc
@ -68,7 +68,7 @@ QgsPointLocator *QgsSnappingUtils::locatorForLayerUsingStrategy( QgsVectorLayer
|
|||||||
|
|
||||||
QgsPointLocator *loc = locatorForLayer( vl );
|
QgsPointLocator *loc = locatorForLayer( vl );
|
||||||
|
|
||||||
if ( isIndexPrepared( loc, aoi ) )
|
if ( loc->isIndexing() || isIndexPrepared( loc, aoi ) )
|
||||||
return loc;
|
return loc;
|
||||||
else
|
else
|
||||||
return temporaryLocatorForLayer( vl, pointMap, tolerance );
|
return temporaryLocatorForLayer( vl, pointMap, tolerance );
|
||||||
@ -91,9 +91,6 @@ QgsPointLocator *QgsSnappingUtils::temporaryLocatorForLayer( QgsVectorLayer *vl,
|
|||||||
|
|
||||||
bool QgsSnappingUtils::isIndexPrepared( QgsPointLocator *loc, const QgsRectangle &areaOfInterest )
|
bool QgsSnappingUtils::isIndexPrepared( QgsPointLocator *loc, const QgsRectangle &areaOfInterest )
|
||||||
{
|
{
|
||||||
if ( loc->isIndexing() )
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if ( mStrategy == IndexAlwaysFull && loc->hasIndex() )
|
if ( mStrategy == IndexAlwaysFull && loc->hasIndex() )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -374,7 +371,7 @@ void QgsSnappingUtils::prepareIndex( const QList<LayerAndAreaOfInterest> &layers
|
|||||||
|
|
||||||
QgsPointLocator *loc = locatorForLayer( vl );
|
QgsPointLocator *loc = locatorForLayer( vl );
|
||||||
|
|
||||||
if ( !isIndexPrepared( loc, entry.second ) )
|
if ( !loc->isIndexing() && !isIndexPrepared( loc, entry.second ) )
|
||||||
layersToIndex << entry;
|
layersToIndex << entry;
|
||||||
}
|
}
|
||||||
if ( !layersToIndex.isEmpty() )
|
if ( !layersToIndex.isEmpty() )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user