From f3235f7c436d07f4350c67de1241595160be47b0 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Mon, 6 Aug 2018 12:20:43 +1000 Subject: [PATCH] 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. --- src/gui/symbology/qgssymbolselectordialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/symbology/qgssymbolselectordialog.cpp b/src/gui/symbology/qgssymbolselectordialog.cpp index c0311f6c93f..9e657bdc3e8 100644 --- a/src/gui/symbology/qgssymbolselectordialog.cpp +++ b/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 );