Skip to content

Commit 148e808

Browse files
committedOct 20, 2015
Fix snapping may never be indexed
1 parent 441f6f8 commit 148e808

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed
 

‎src/core/qgssnappingutils.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -318,22 +318,22 @@ void QgsSnappingUtils::prepareIndex( const QList<QgsVectorLayer*>& layers )
318318
if ( willUseIndex( vl ) && !locatorForLayer( vl )->hasIndex() )
319319
layersToIndex << vl;
320320
}
321-
if ( layersToIndex.isEmpty() )
322-
return;
323-
324-
// build indexes
325-
QTime t; t.start();
326-
int i = 0;
327-
prepareIndexStarting( layersToIndex.count() );
328-
Q_FOREACH ( QgsVectorLayer* vl, layersToIndex )
321+
if ( !layersToIndex.isEmpty() )
329322
{
330-
QTime tt; tt.start();
331-
if ( !locatorForLayer( vl )->init( mStrategy == IndexHybrid ? 1000000 : -1 ) )
332-
mHybridNonindexableLayers.insert( vl->id() );
333-
QgsDebugMsg( QString( "Index init: %1 ms (%2)" ).arg( tt.elapsed() ).arg( vl->id() ) );
334-
prepareIndexProgress( ++i );
323+
// build indexes
324+
QTime t; t.start();
325+
int i = 0;
326+
prepareIndexStarting( layersToIndex.count() );
327+
Q_FOREACH ( QgsVectorLayer* vl, layersToIndex )
328+
{
329+
QTime tt; tt.start();
330+
if ( !locatorForLayer( vl )->init( mStrategy == IndexHybrid ? 1000000 : -1 ) )
331+
mHybridNonindexableLayers.insert( vl->id() );
332+
QgsDebugMsg( QString( "Index init: %1 ms (%2)" ).arg( tt.elapsed() ).arg( vl->id() ) );
333+
prepareIndexProgress( ++i );
334+
}
335+
QgsDebugMsg( QString( "Prepare index total: %1 ms" ).arg( t.elapsed() ) );
335336
}
336-
QgsDebugMsg( QString( "Prepare index total: %1 ms" ).arg( t.elapsed() ) );
337337
mIsIndexing = false;
338338
}
339339

0 commit comments

Comments
 (0)
Please sign in to comment.