Skip to content

Commit f3235f7

Browse files
committed
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.
1 parent 7027763 commit f3235f7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/gui/symbology/qgssymbolselectordialog.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ QgsSymbolSelectorWidget::QgsSymbolSelectorWidget( QgsSymbol *symbol, QgsStyle *s
253253
//get first feature from layer for previews
254254
if ( mVectorLayer )
255255
{
256-
QgsFeatureIterator it = mVectorLayer->getFeatures( QgsFeatureRequest().setLimit( 1 ) );
256+
// short timeout for request - it doesn't really matter if we don't get the feature, and this call is blocking UI
257+
QgsFeatureIterator it = mVectorLayer->getFeatures( QgsFeatureRequest().setLimit( 1 ).setConnectionTimeout( 100 ) );
257258
it.nextFeature( mPreviewFeature );
258259
mPreviewExpressionContext.appendScopes( QgsExpressionContextUtils::globalProjectLayerScopes( mVectorLayer ) );
259260
mPreviewExpressionContext.setFeature( mPreviewFeature );

0 commit comments

Comments
 (0)