avoid loading runners if the query is empty

svn path=/trunk/KDE/kdelibs/; revision=1029903
This commit is contained in:
Aaron J. Seigo 2009-10-01 00:58:24 +00:00
parent cd65144478
commit df3892d06d

View File

@ -404,15 +404,15 @@ void RunnerManager::launchQuery(const QString &untrimmedTerm, const QString &run
setupMatchSession();
QString term = untrimmedTerm.trimmed();
if (d->runners.isEmpty()) {
d->loadRunners();
}
if (term.isEmpty()) {
reset();
return;
}
if (d->runners.isEmpty()) {
d->loadRunners();
}
if (d->context.query() == term) {
// we already are searching for this!
return;
@ -459,15 +459,15 @@ bool RunnerManager::execQuery(const QString &untrimmedTerm, const QString &runne
{
QString term = untrimmedTerm.trimmed();
if (d->runners.isEmpty()) {
d->loadRunners();
}
if (term.isEmpty()) {
reset();
return false;
}
if (d->runners.isEmpty()) {
d->loadRunners();
}
if (d->context.query() == term) {
// we already are searching for this!
emit matchesChanged(d->context.matches());