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.

(cherry-picked from b422504)
  • Loading branch information
nyalldawson committed Aug 16, 2018
1 parent c4eb57d commit 01b4ede
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gui/symbology/qgssymbolselectordialog.cpp
Expand Up @@ -253,10 +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 ) );
it.nextFeature( mPreviewFeature );
#endif
mPreviewExpressionContext.appendScopes( QgsExpressionContextUtils::globalProjectLayerScopes( mVectorLayer ) );
#if 0
mPreviewExpressionContext.setFeature( mPreviewFeature );
#endif
}
else
{
Expand Down

0 comments on commit 01b4ede

Please sign in to comment.