Skip to content

Commit

Permalink
Trim and simplify the query from the locator widget
Browse files Browse the repository at this point in the history
  • Loading branch information
suricactus authored and nyalldawson committed Mar 17, 2020
1 parent 018b03f commit 4f269a5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/locator/qgslocatormodelbridge.cpp
Expand Up @@ -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() );
}
}

Expand Down

0 comments on commit 4f269a5

Please sign in to comment.