From 2203be8e135d0b2dfc546aee15b3ee44b43cbdde Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Wed, 13 Feb 2013 13:50:45 +0100 Subject: [PATCH] slightly smarter handling of single runners --- plasma/runnermanager.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/plasma/runnermanager.cpp b/plasma/runnermanager.cpp index ad8478b85..8b0e3a79b 100644 --- a/plasma/runnermanager.cpp +++ b/plasma/runnermanager.cpp @@ -716,10 +716,14 @@ void RunnerManager::launchQuery(const QString &untrimmedTerm, const QString &run QString term = untrimmedTerm.trimmed(); setSingleModeRunnerId(runnerName); - setSingleMode(!runnerName.isEmpty()); + setSingleMode(d->currentSingleRunner); + if (!runnerName.isEmpty() && !d->currentSingleRunner) { + reset(); + return; + } if (term.isEmpty()) { - if (d->singleMode && d->currentSingleRunner && d->currentSingleRunner->defaultSyntax()) { + if (d->singleMode && d->currentSingleRunner->defaultSyntax()) { term = d->currentSingleRunner->defaultSyntax()->exampleQueries().first().remove(QRegExp(":q:")); } else { reset(); @@ -732,12 +736,7 @@ void RunnerManager::launchQuery(const QString &untrimmedTerm, const QString &run return; } - if (d->singleMode && !d->currentSingleRunner) { - reset(); - return; - } - - if (d->runners.isEmpty()) { + if (!d->singleMode && d->runners.isEmpty()) { d->loadRunners(); } @@ -748,7 +747,7 @@ void RunnerManager::launchQuery(const QString &untrimmedTerm, const QString &run QHash runable; //if the name is not empty we will launch only the specified runner - if (d->singleMode && d->currentSingleRunner) { + if (d->singleMode) { runable.insert(QString(), d->currentSingleRunner); d->context.setSingleRunnerQueryMode(true); } else {