Skip to content
Permalink
Browse files

[all features locator] respect search limits

  • Loading branch information
github-actions authored and nyalldawson committed Nov 18, 2020
1 parent cbe9927 commit 0284dcf30f2696b5d5e8a7fbb8bbe1b633f8a9f2
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/app/locator/qgsinbuiltlocatorfilters.cpp
@@ -563,12 +563,12 @@ QStringList QgsAllLayersFeaturesLocatorFilter::prepare( const QString &string, c
enhancedSearch.replace( ' ', '%' );
req.setFilterExpression( QStringLiteral( "%1 ILIKE '%%2%'" )
.arg( layer->displayExpression(), enhancedSearch ) );
req.setLimit( 6 );
req.setLimit( mMaxResultsPerLayer );

QgsFeatureRequest exactMatchRequest = req;
exactMatchRequest.setFilterExpression( QStringLiteral( "%1 ILIKE '%2'" )
.arg( layer->displayExpression(), enhancedSearch ) );
exactMatchRequest.setLimit( 10 );
exactMatchRequest.setLimit( mMaxResultsPerLayer );

std::shared_ptr<PreparedLayer> preparedLayer( new PreparedLayer() );
preparedLayer->expression = expression;
@@ -625,6 +625,8 @@ void QgsAllLayersFeaturesLocatorFilter::fetchResults( const QString &string, con
if ( foundInCurrentLayer >= mMaxResultsPerLayer )
break;
}
if ( foundInCurrentLayer >= mMaxResultsPerLayer )
continue;
if ( foundInTotal >= mMaxTotalResults )
break;

0 comments on commit 0284dcf

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