Changeset View
Changeset View
Standalone View
Standalone View
src/runnermanager.cpp
Show First 20 Lines • Show All 357 Lines • ▼ Show 20 Line(s) | 352 | { | |||
---|---|---|---|---|---|
358 | 358 | | |||
359 | if (Queue::instance()->isIdle()) { | 359 | if (Queue::instance()->isIdle()) { | ||
360 | searchJobs.clear(); | 360 | searchJobs.clear(); | ||
361 | oldSearchJobs.clear(); | 361 | oldSearchJobs.clear(); | ||
362 | } | 362 | } | ||
363 | 363 | | |||
364 | if (searchJobs.isEmpty() && oldSearchJobs.isEmpty()) { | 364 | if (searchJobs.isEmpty() && oldSearchJobs.isEmpty()) { | ||
365 | if (allRunnersPrepped) { | 365 | if (allRunnersPrepped) { | ||
366 | foreach (AbstractRunner *runner, runners) { | 366 | for (AbstractRunner *runner : qAsConst(runners)) { | ||
367 | emit runner->teardown(); | 367 | emit runner->teardown(); | ||
368 | } | 368 | } | ||
369 | 369 | | |||
370 | allRunnersPrepped = false; | 370 | allRunnersPrepped = false; | ||
371 | } | 371 | } | ||
372 | 372 | | |||
373 | if (singleRunnerPrepped) { | 373 | if (singleRunnerPrepped) { | ||
374 | if (currentSingleRunner) { | 374 | if (currentSingleRunner) { | ||
▲ Show 20 Lines • Show All 337 Lines • ▼ Show 20 Line(s) | 706 | { | |||
712 | 712 | | |||
713 | d->prepped = true; | 713 | d->prepped = true; | ||
714 | if (d->singleMode) { | 714 | if (d->singleMode) { | ||
715 | if (d->currentSingleRunner) { | 715 | if (d->currentSingleRunner) { | ||
716 | emit d->currentSingleRunner->prepare(); | 716 | emit d->currentSingleRunner->prepare(); | ||
717 | d->singleRunnerPrepped = true; | 717 | d->singleRunnerPrepped = true; | ||
718 | } | 718 | } | ||
719 | } else { | 719 | } else { | ||
720 | foreach (AbstractRunner *runner, d->runners) { | 720 | for (AbstractRunner *runner : qAsConst(d->runners)) { | ||
721 | #ifdef MEASURE_PREPTIME | 721 | #ifdef MEASURE_PREPTIME | ||
722 | QTime t; | 722 | QTime t; | ||
723 | t.start(); | 723 | t.start(); | ||
724 | #endif | 724 | #endif | ||
725 | emit runner->prepare(); | 725 | emit runner->prepare(); | ||
726 | #ifdef MEASURE_PREPTIME | 726 | #ifdef MEASURE_PREPTIME | ||
727 | #ifndef NDEBUG | 727 | #ifndef NDEBUG | ||
728 | // qCDebug(KRUNNER) << t.elapsed() << runner->name(); | 728 | // qCDebug(KRUNNER) << t.elapsed() << runner->name(); | ||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 783 | // qCDebug(KRUNNER) << "runners searching for" << term << "on" << runnerName; | |||
789 | //if the name is not empty we will launch only the specified runner | 789 | //if the name is not empty we will launch only the specified runner | ||
790 | if (d->singleMode) { | 790 | if (d->singleMode) { | ||
791 | runable.insert(QString(), d->currentSingleRunner); | 791 | runable.insert(QString(), d->currentSingleRunner); | ||
792 | d->context.setSingleRunnerQueryMode(true); | 792 | d->context.setSingleRunnerQueryMode(true); | ||
793 | } else { | 793 | } else { | ||
794 | runable = d->runners; | 794 | runable = d->runners; | ||
795 | } | 795 | } | ||
796 | 796 | | |||
797 | foreach (Plasma::AbstractRunner *r, runable) { | 797 | for (Plasma::AbstractRunner *r : qAsConst(runable)) { | ||
798 | if (r->isMatchingSuspended()) { | 798 | if (r->isMatchingSuspended()) { | ||
799 | continue; | 799 | continue; | ||
800 | } | 800 | } | ||
801 | 801 | | |||
802 | d->startJob(r); | 802 | d->startJob(r); | ||
803 | } | 803 | } | ||
804 | 804 | | |||
805 | // Start timer to unblock slow runners | 805 | // Start timer to unblock slow runners | ||
Show All 36 Lines |