Skip to content

Commit

Permalink
Disable feature fetching for symbol selector widget preview
Browse files Browse the repository at this point in the history
It's just too expensive for any remote provider, e.g. wfs, and
causes many ui lockups. Revisit when support for iterator
timeouts is more mature.
  • Loading branch information
nyalldawson committed Aug 16, 2018
1 parent 291224e commit b422504
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/gui/symbology/qgssymbolselectordialog.cpp
Expand Up @@ -253,11 +253,15 @@ QgsSymbolSelectorWidget::QgsSymbolSelectorWidget( QgsSymbol *symbol, QgsStyle *s
//get first feature from layer for previews
if ( mVectorLayer )
{
#if 0 // this is too expensive to do for many providers. TODO revisit when support for connection timeouts is complete across all providers
// short timeout for request - it doesn't really matter if we don't get the feature, and this call is blocking UI
QgsFeatureIterator it = mVectorLayer->getFeatures( QgsFeatureRequest().setLimit( 1 ).setConnectionTimeout( 100 ) );
it.nextFeature( mPreviewFeature );
#endif
mPreviewExpressionContext.appendScopes( QgsExpressionContextUtils::globalProjectLayerScopes( mVectorLayer ) );
#if 0
mPreviewExpressionContext.setFeature( mPreviewFeature );
#endif
}
else
{
Expand Down

0 comments on commit b422504

Please sign in to comment.