remove RunnerManager::execQuery()
This commit is contained in:
parent
c3e2a6e671
commit
5a82aa9211
@ -766,51 +766,6 @@ void RunnerManager::launchQuery(const QString &untrimmedTerm, const QString &run
|
||||
d->delayTimer.start(RunnerManagerPrivate::slowRunDelay);
|
||||
}
|
||||
|
||||
bool RunnerManager::execQuery(const QString &term)
|
||||
{
|
||||
return execQuery(term, QString());
|
||||
}
|
||||
|
||||
bool RunnerManager::execQuery(const QString &untrimmedTerm, const QString &runnerName)
|
||||
{
|
||||
QString term = untrimmedTerm.trimmed();
|
||||
|
||||
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());
|
||||
return false;
|
||||
}
|
||||
|
||||
reset();
|
||||
//kDebug() << "executing query about " << term << "on" << runnerName;
|
||||
d->context.setQuery(term);
|
||||
AbstractRunner *r = runner(runnerName);
|
||||
|
||||
if (!r) {
|
||||
//kDebug() << "failed to find the runner";
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((r->ignoredTypes() & d->context.type()) != 0) {
|
||||
//kDebug() << "ignored!";
|
||||
return false;
|
||||
}
|
||||
|
||||
r->performMatch(d->context);
|
||||
//kDebug() << "succeeded with" << d->context.matches().count() << "results";
|
||||
emit matchesChanged(d->context.matches());
|
||||
return true;
|
||||
}
|
||||
|
||||
QString RunnerManager::query() const
|
||||
{
|
||||
return d->context.query();
|
||||
|
@ -252,22 +252,6 @@ class PLASMA_EXPORT RunnerManager : public QObject
|
||||
*/
|
||||
void launchQuery(const QString &term);
|
||||
|
||||
/**
|
||||
* Execute a query, this method will only return when the query is executed
|
||||
* This means that the method may be dangerous as it wait a variable amount
|
||||
* of time for the runner to finish.
|
||||
* The runner parameter is mandatory, to avoid launching unwanted runners.
|
||||
* @param term the term we want to find matches for
|
||||
* @param runner the runner we will use, it is mandatory
|
||||
* @return 0 if nothing was launched, 1 if launched.
|
||||
*/
|
||||
bool execQuery(const QString &term, const QString &runnerName);
|
||||
|
||||
/**
|
||||
* Convenience version of above
|
||||
*/
|
||||
bool execQuery(const QString &term);
|
||||
|
||||
/**
|
||||
* Reset the current data and stops the query
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user