Skip to content

Commit

Permalink
[locator] do not skip less than 3 chars when using prefix
Browse files Browse the repository at this point in the history
you might really be looking for it, using the prefix makes it clear enough
  • Loading branch information
3nids authored and nyalldawson committed Sep 12, 2018
1 parent 98a4bd3 commit efed091
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/locator/qgsinbuiltlocatorfilters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ QgsActiveLayerFeaturesLocatorFilter *QgsActiveLayerFeaturesLocatorFilter::clone(
return new QgsActiveLayerFeaturesLocatorFilter();
}

void QgsActiveLayerFeaturesLocatorFilter::prepare( const QString &string, const QgsLocatorContext & )
void QgsActiveLayerFeaturesLocatorFilter::prepare( const QString &string, const QgsLocatorContext &context )
{
if ( string.length() < 3 )
if ( string.length() < 3 || context.usingPrefix )
return;

bool allowNumeric = false;
Expand Down Expand Up @@ -317,9 +317,9 @@ QgsAllLayersFeaturesLocatorFilter *QgsAllLayersFeaturesLocatorFilter::clone() co
return new QgsAllLayersFeaturesLocatorFilter();
}

void QgsAllLayersFeaturesLocatorFilter::prepare( const QString &string, const QgsLocatorContext & )
void QgsAllLayersFeaturesLocatorFilter::prepare( const QString &string, const QgsLocatorContext &context )
{
if ( string.length() < 3 )
if ( string.length() < 3 || context.usingPrefix )
return;

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

0 comments on commit efed091

Please sign in to comment.