Skip to content

Commit

Permalink
Fix snapping may never be indexed
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 20, 2015
1 parent 441f6f8 commit 148e808
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/core/qgssnappingutils.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit 148e808

Please sign in to comment.