diff --git a/src/plasma/private/runnerjobs.cpp b/src/plasma/private/runnerjobs.cpp index 3c24c698b..37ba157e5 100644 --- a/src/plasma/private/runnerjobs.cpp +++ b/src/plasma/private/runnerjobs.cpp @@ -24,13 +24,14 @@ #include //#include -#include +#include +#include #include "runnermanager.h" #include "plasma/querymatch.h" using ThreadWeaver::Job; -using ThreadWeaver::Weaver; +using ThreadWeaver::Queue; namespace Plasma { @@ -172,8 +173,8 @@ Plasma::AbstractRunner* FindMatchesJob::runner() const } DelayedJobCleaner::DelayedJobCleaner(const QSet > &jobs, const QSet &runners) - : QObject(Weaver::instance()), - m_weaver(Weaver::instance()), + : QObject(Queue::instance()), + m_weaver(Queue::instance()), m_jobs(jobs), m_runners(runners) { diff --git a/src/plasma/private/runnerjobs_p.h b/src/plasma/private/runnerjobs_p.h index 830d9a020..ef0f98f20 100644 --- a/src/plasma/private/runnerjobs_p.h +++ b/src/plasma/private/runnerjobs_p.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include "abstractrunner.h" @@ -125,7 +125,7 @@ private Q_SLOTS: void checkIfFinished(); private: - ThreadWeaver::Weaver *m_weaver; + ThreadWeaver::Queue *m_weaver; QSet > m_jobs; QSet m_runners; }; diff --git a/src/plasma/runnermanager.cpp b/src/plasma/runnermanager.cpp index cd76a57f6..50de33f71 100644 --- a/src/plasma/runnermanager.cpp +++ b/src/plasma/runnermanager.cpp @@ -38,15 +38,14 @@ #endif #include -#include +#include #include -#include #include "private/runnerjobs_p.h" #include "pluginloader.h" #include "querymatch.h" -using ThreadWeaver::Weaver; +using ThreadWeaver::Queue; using ThreadWeaver::Job; //#define MEASURE_PREPTIME @@ -112,8 +111,8 @@ public: const int maxThreads = config.readEntry("maxThreads", 16); const int numThreads = qMin(maxThreads, 2 + ((numProcs - 1) * 2)); //qDebug() << "setting up" << numThreads << "threads for" << numProcs << "processors"; - if (numThreads > Weaver::instance()->maximumNumberOfThreads()) { - Weaver::instance()->setMaximumNumberOfThreads(numThreads); + if (numThreads > Queue::instance()->maximumNumberOfThreads()) { + Queue::instance()->setMaximumNumberOfThreads(numThreads); } // Limit the number of instances of a single normal speed runner and all of the slow runners // to half the number of threads @@ -353,7 +352,7 @@ public: return; } - if (Weaver::instance()->isIdle()) { + if (Queue::instance()->isIdle()) { searchJobs.clear(); oldSearchJobs.clear(); } @@ -384,13 +383,13 @@ public: void unblockJobs() { - if (searchJobs.isEmpty() && Weaver::instance()->isIdle()) { + if (searchJobs.isEmpty() && Queue::instance()->isIdle()) { oldSearchJobs.clear(); checkTearDown(); return; } - Weaver::instance()->reschedule(); + Queue::instance()->reschedule(); } void runnerMatchingSuspended(bool suspended) @@ -409,12 +408,12 @@ public: void startJob(AbstractRunner *runner) { if ((runner->ignoredTypes() & context.type()) == 0) { - QSharedPointer job(new FindMatchesJob(runner, &context, Weaver::instance())); + QSharedPointer job(new FindMatchesJob(runner, &context, Queue::instance())); QObject::connect(job->decorator(), SIGNAL(done(ThreadWeaver::JobPointer)), q, SLOT(jobDone(ThreadWeaver::JobPointer))); if (runner->speed() == AbstractRunner::SlowSpeed) { job->setDelayTimer(&delayTimer); } - Weaver::instance()->enqueue(job); + Queue::instance()->enqueue(job); searchJobs.insert(job); } } @@ -775,11 +774,11 @@ QString RunnerManager::query() const void RunnerManager::reset() { // If ThreadWeaver is idle, it is safe to clear previous jobs - if (Weaver::instance()->isIdle()) { + if (Queue::instance()->isIdle()) { d->oldSearchJobs.clear(); } else { for (auto it = d->searchJobs.constBegin(); it != d->searchJobs.constEnd(); ++it) { - Weaver::instance()->dequeue((*it)); + Queue::instance()->dequeue((*it)); } d->oldSearchJobs += d->searchJobs; }