Skip to content

Commit

Permalink
Short connection timeout for symbol selector preview feature fetching
Browse files Browse the repository at this point in the history
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 f3235f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gui/symbology/qgssymbolselectordialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

1 comment on commit f3235f7

@nirvn
Copy link
Contributor

@nirvn nirvn commented on f3235f7 Aug 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.