Skip to content
Permalink
Browse files

Fix snapping may never be indexed

  • Loading branch information
m-kuhn committed Oct 20, 2015
1 parent 441f6f8 commit 148e8082021dffd0dd471b3dce14f3433d0094f6
Showing with 14 additions and 14 deletions.
  1. +14 −14 src/core/qgssnappingutils.cpp
@@ -318,22 +318,22 @@ void QgsSnappingUtils::prepareIndex( const QList<QgsVectorLayer*>& layers )
if ( willUseIndex( vl ) && !locatorForLayer( vl )->hasIndex() )
layersToIndex << vl;
}
if ( layersToIndex.isEmpty() )
return;

// build indexes
QTime t; t.start();
int i = 0;
prepareIndexStarting( layersToIndex.count() );
Q_FOREACH ( QgsVectorLayer* vl, layersToIndex )
if ( !layersToIndex.isEmpty() )
{
QTime tt; tt.start();
if ( !locatorForLayer( vl )->init( mStrategy == IndexHybrid ? 1000000 : -1 ) )
mHybridNonindexableLayers.insert( vl->id() );
QgsDebugMsg( QString( "Index init: %1 ms (%2)" ).arg( tt.elapsed() ).arg( vl->id() ) );
prepareIndexProgress( ++i );
// build indexes
QTime t; t.start();
int i = 0;
prepareIndexStarting( layersToIndex.count() );
Q_FOREACH ( QgsVectorLayer* vl, layersToIndex )
{
QTime tt; tt.start();
if ( !locatorForLayer( vl )->init( mStrategy == IndexHybrid ? 1000000 : -1 ) )
mHybridNonindexableLayers.insert( vl->id() );
QgsDebugMsg( QString( "Index init: %1 ms (%2)" ).arg( tt.elapsed() ).arg( vl->id() ) );
prepareIndexProgress( ++i );
}
QgsDebugMsg( QString( "Prepare index total: %1 ms" ).arg( t.elapsed() ) );
}
QgsDebugMsg( QString( "Prepare index total: %1 ms" ).arg( t.elapsed() ) );
mIsIndexing = false;
}

0 comments on commit 148e808

Please sign in to comment.
You can’t perform that action at this time.