diff --git a/runnermanager.cpp b/runnermanager.cpp index 0e9494d63..0299292af 100644 --- a/runnermanager.cpp +++ b/runnermanager.cpp @@ -191,8 +191,12 @@ public: Private(RunnerManager *parent) : q(parent) { - connect(&context, SIGNAL(matchesChanged()), q, SIGNAL(matchesChanged())); - connect(Weaver::instance(), SIGNAL(finished()), q, SIGNAL(matchesCompleted())); + connect(&context, SIGNAL(matchesChanged()), q, SLOT(matchesChanged())); + } + + void matchesChanged() + { + emit q->matchesChanged(context.matches()); } void loadConfiguration(KConfigGroup& conf) @@ -369,13 +373,9 @@ void RunnerManager::launchQuery (const QString & term, const QString & runnerNam d->searchJobs.append( job ); } } - - if (!jobsLaunched) { - emit matchesCompleted(); - } } -bool RunnerManager::execQuery (const QString & term, const QString & runnerName) +bool RunnerManager::execQuery(const QString & term, const QString & runnerName) { if (term.isEmpty()) { reset(); @@ -402,7 +402,7 @@ bool RunnerManager::execQuery (const QString & term, const QString & runnerName) } r->performMatch(d->context); - emit matchesCompleted(); + emit matchesChanged(d->context.matches()); return true; } diff --git a/runnermanager.h b/runnermanager.h index 180bc1c51..da7b33eba 100644 --- a/runnermanager.h +++ b/runnermanager.h @@ -77,8 +77,8 @@ class PLASMA_EXPORT RunnerManager : public QObject /** * Launch a query, this will create threads and return inmediately. * When the information will be available can be known using the - * matchesChanged, matchesUpdated, matchesCompleted signals - * The information can be retrieved calling matches + * matchesChanged signal. + * * @arg term the term we want to find matches for * @arg runner optional, if only one specific runner is to be used */ @@ -104,14 +104,10 @@ class PLASMA_EXPORT RunnerManager : public QObject /** * Emited each time a new match is added to the list */ - void matchesChanged(); - - /** - * Emited when all the matches have been found - */ - void matchesCompleted(); + void matchesChanged(const QList &matches); private: + Q_PRIVATE_SLOT(d, void matchesChanged()); class Private; Private * const d; };