Skip to content
Permalink
Browse files

Short connection timeout for symbol selector preview feature fetching

Because we don't really care if we couldn't fulfill this request,
and the request itself is blocking UI.
  • Loading branch information
nyalldawson committed Aug 6, 2018
1 parent 7027763 commit f3235f7c436d07f4350c67de1241595160be47b0
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/gui/symbology/qgssymbolselectordialog.cpp
@@ -253,7 +253,8 @@ QgsSymbolSelectorWidget::QgsSymbolSelectorWidget( QgsSymbol *symbol, QgsStyle *s
//get first feature from layer for previews
if ( mVectorLayer )
{
QgsFeatureIterator it = mVectorLayer->getFeatures( QgsFeatureRequest().setLimit( 1 ) );
// 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 );
mPreviewExpressionContext.appendScopes( QgsExpressionContextUtils::globalProjectLayerScopes( mVectorLayer ) );
mPreviewExpressionContext.setFeature( mPreviewFeature );

1 comment on commit f3235f7

@nirvn

This comment has been minimized.

Copy link
Contributor

@nirvn nirvn commented on f3235f7 Aug 15, 2018

This commit has led to a crasher: https://issues.qgis.org/issues/19625

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