The min letter count property is set to 3, which means that shorter queries will not be
sent to the runner. Consequently we can remove all of the code which has worked around
the issue of short queries taking much CPU power and delaying the runner.
// Baloo (as of 2014-11-20) is single threaded. It has an internal mutex which results in
// queries being queued one after another. Also, Baloo is really really slow for small queries
// For example - on my SSD, it takes about 1.4 seconds for 'f' with an SSD.
// When searching for "fire", it results in "f", "fi", "fir" and then "fire" being searched
// We're therefore hacking around this by having a small delay for very short queries so that
// they do not get queued internally in Baloo
//
intwaitTimeMs=0;
if(searchTerm.length()<=3){
waitTimeMs=100;
}
// we're still using the event delayed call even when the length is < 3 so that if we have multiple Match() calls in our DBus queue, we only process the
// last one
m_timer->start(waitTimeMs);
returnRemoteMatches();
}
voidSearchRunner::performMatch()
{
// Filter out duplicates
QSet<QUrl>foundUrls;
// The location runner handles file paths, otherwise we would end up with duplicate entries