Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3c95b8b

Browse files
authoredSep 12, 2018
[locator] do not skip less than 3 chars when using prefix
you might really be looking for it, using the prefix makes it clear enough
1 parent 3b1b41f commit 3c95b8b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/app/locator/qgsinbuiltlocatorfilters.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ QgsActiveLayerFeaturesLocatorFilter *QgsActiveLayerFeaturesLocatorFilter::clone(
206206
return new QgsActiveLayerFeaturesLocatorFilter();
207207
}
208208

209-
void QgsActiveLayerFeaturesLocatorFilter::prepare( const QString &string, const QgsLocatorContext & )
209+
void QgsActiveLayerFeaturesLocatorFilter::prepare( const QString &string, const QgsLocatorContext &context )
210210
{
211-
if ( string.length() < 3 )
211+
if ( string.length() < 3 || context.usingPrefix )
212212
return;
213213

214214
bool allowNumeric = false;
@@ -317,9 +317,9 @@ QgsAllLayersFeaturesLocatorFilter *QgsAllLayersFeaturesLocatorFilter::clone() co
317317
return new QgsAllLayersFeaturesLocatorFilter();
318318
}
319319

320-
void QgsAllLayersFeaturesLocatorFilter::prepare( const QString &string, const QgsLocatorContext & )
320+
void QgsAllLayersFeaturesLocatorFilter::prepare( const QString &string, const QgsLocatorContext &context )
321321
{
322-
if ( string.length() < 3 )
322+
if ( string.length() < 3 || context.usingPrefix )
323323
return;
324324

325325
const QMap<QString, QgsMapLayer *> layers = QgsProject::instance()->mapLayers();

0 commit comments

Comments
 (0)
Please sign in to comment.