Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
  • Loading branch information
3nids and nyalldawson committed Sep 24, 2020
1 parent f87fb04 commit d7b9e0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/app/locator/qgsinbuiltlocatorfilters.cpp
Expand Up @@ -262,7 +262,7 @@ QStringList QgsActiveLayerFeaturesLocatorFilter::prepare( const QString &string,
mFieldsCompletion.clear();

// Normally skip very short search strings, unless when specifically searching using this filter or try to match fields
if ( string.length() < 3 && !context.usingPrefix && !string.startsWith( QStringLiteral( "@" ) ) )
if ( string.length() < 3 && !context.usingPrefix && !string.startsWith( '@' ) ) )
return QStringList();

QgsSettings settings;
Expand Down Expand Up @@ -1133,4 +1133,3 @@ void QgsGotoLocatorFilter::triggerResult( const QgsLocatorResult &result )

mapCanvas->flashGeometries( QList< QgsGeometry >() << QgsGeometry::fromPointXY( point ) );
}

2 changes: 1 addition & 1 deletion tests/src/app/testqgsapplocatorfilters.cpp
Expand Up @@ -224,7 +224,7 @@ void TestQgsAppLocatorFilters::testActiveLayerFieldRestriction()
search = QStringLiteral( "@" );
restr = QgsActiveLayerFeaturesLocatorFilter::fieldRestriction( search );
QVERIFY( !restr.isNull() );
QCOMPARE( search, QStringLiteral( "" ) );
QCOMPARE( search, QString() );

search = QStringLiteral( "hello there" );
restr = QgsActiveLayerFeaturesLocatorFilter::fieldRestriction( search );
Expand Down

0 comments on commit d7b9e0b

Please sign in to comment.