Skip to content
Permalink
Browse files

Trim and simplify the query from the locator widget

  • Loading branch information
suricactus authored and nyalldawson committed Mar 12, 2020
1 parent 018b03f commit 4f269a5af30f7efc91485b144ff439a8fd56e5fd
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/core/locator/qgslocatormodelbridge.cpp
@@ -102,21 +102,24 @@ void QgsLocatorModelBridge::searchFinished()
void QgsLocatorModelBridge::performSearch( const QString &text )
{
setIsRunning( true );

QString textSimplified = text.simplified();

if ( mLocator->isRunning() )
{
// can't do anything while a query is running, and can't block
// here waiting for the current query to cancel
// so we queue up this string until cancel has happened
mLocator->cancelWithoutBlocking();
mNextRequestedString = text;
mNextRequestedString = textSimplified;
mHasQueuedRequest = true;
return;
}
else
{
emit resultsCleared();
mLocatorModel->deferredClear();
mLocator->fetchResults( text, createContext() );
mLocator->fetchResults( textSimplified, createContext() );
}
}

0 comments on commit 4f269a5

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