diff options
Diffstat (limited to 'src/plugins/projectexplorer')
-rw-r--r-- | src/plugins/projectexplorer/appoutputpane.cpp | 8 | ||||
-rw-r--r-- | src/plugins/projectexplorer/appoutputpane.h | 3 | ||||
-rw-r--r-- | src/plugins/projectexplorer/projectexplorer.cpp | 11 | ||||
-rw-r--r-- | src/plugins/projectexplorer/projectexplorer.h | 1 | ||||
-rw-r--r-- | src/plugins/projectexplorer/projecttreewidget.cpp | 2 | ||||
-rw-r--r-- | src/plugins/projectexplorer/projecttreewidget.h | 2 | ||||
-rw-r--r-- | src/plugins/projectexplorer/runconfiguration.cpp | 299 | ||||
-rw-r--r-- | src/plugins/projectexplorer/runconfiguration.h | 39 |
8 files changed, 202 insertions, 163 deletions
diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index 9e0617454b..1e6ef0efd6 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -420,7 +420,8 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc) if (tabIndex != -1) { RunControlTab &tab = m_runControlTabs[tabIndex]; // Reuse this tab - delete tab.runControl; + if (tab.runControl) + tab.runControl->initiateFinish(); tab.runControl = rc; tab.window->setFormatter(rc ? rc->outputFormatter() : nullptr); @@ -559,7 +560,7 @@ bool AppOutputPane::closeTabs(CloseTabMode mode) QList<RunControl *> AppOutputPane::allRunControls() const { return Utils::transform<QList>(m_runControlTabs,[](const RunControlTab &tab) { - return tab.runControl; + return tab.runControl.data(); }); } @@ -596,7 +597,8 @@ bool AppOutputPane::closeTab(int tabIndex, CloseTabMode closeTabMode) m_tabWidget->removeTab(tabIndex); delete m_runControlTabs[index].window; - delete m_runControlTabs[index].runControl; + m_runControlTabs[index].runControl->initiateFinish(); // Will self-destruct. + m_runControlTabs[index].runControl = 0; m_runControlTabs.removeAt(index); updateCloseActions(); diff --git a/src/plugins/projectexplorer/appoutputpane.h b/src/plugins/projectexplorer/appoutputpane.h index ba3839ca6a..b260447ba5 100644 --- a/src/plugins/projectexplorer/appoutputpane.h +++ b/src/plugins/projectexplorer/appoutputpane.h @@ -25,6 +25,7 @@ #pragma once +#include <QPointer> #include <QVector> #include <coreplugin/ioutputpane.h> @@ -124,7 +125,7 @@ private: public: explicit RunControlTab(RunControl *runControl = nullptr, Core::OutputWindow *window = nullptr); - RunControl *runControl; + QPointer<RunControl> runControl; Core::OutputWindow *window; BehaviorOnOutput behaviorOnOutput = Flash; }; diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 12c3e5f678..5380acb478 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1995,17 +1995,6 @@ static RunControlFactory findRunControlFactory(RunConfiguration *config, Core::I }; } - IRunControlFactory *runControlFactory = ExtensionSystem::PluginManager::getObject<IRunControlFactory>( - [&config, &mode](IRunControlFactory *factory) { - return factory->canRun(config, mode); - }); - - if (runControlFactory) { - return [runControlFactory](RunConfiguration *rc, Id runMode, QString *errorMessage) { - return runControlFactory->create(rc, runMode, errorMessage); - }; - } - return {}; } diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index 58958c08f2..2ffb0d200d 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -48,7 +48,6 @@ namespace Utils { class ProcessHandle; } namespace ProjectExplorer { class RunControl; class RunConfiguration; -class IRunControlFactory; class Project; class Node; class FolderNode; diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index 372dbdb757..2a98fbe86e 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -489,5 +489,5 @@ void ProjectTreeWidgetFactory::restoreSettings(QSettings *settings, int position const QString baseKey = QLatin1String("ProjectTreeWidget.") + QString::number(position); ptw->setProjectFilter(settings->value(baseKey + QLatin1String(".ProjectFilter"), false).toBool()); ptw->setGeneratedFilesFilter(settings->value(baseKey + QLatin1String(".GeneratedFilter"), true).toBool()); - ptw->setAutoSynchronization(settings->value(baseKey + QLatin1String(".SyncWithEditor")).toBool()); + ptw->setAutoSynchronization(settings->value(baseKey + QLatin1String(".SyncWithEditor"), true).toBool()); } diff --git a/src/plugins/projectexplorer/projecttreewidget.h b/src/plugins/projectexplorer/projecttreewidget.h index 072cc1f1ab..69102fedb0 100644 --- a/src/plugins/projectexplorer/projecttreewidget.h +++ b/src/plugins/projectexplorer/projecttreewidget.h @@ -87,7 +87,7 @@ private: QToolButton *m_toggleSync; QString m_modelId; - bool m_autoSync = false; + bool m_autoSync = true; Utils::FileName m_delayedRename; static QList<ProjectTreeWidget *> m_projectTreeWidgets; diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index d098411706..bc3eaac911 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -183,13 +183,16 @@ void IRunConfigurationAspect::resetProjectToGlobalSettings() for a target, but still be runnable via the output tab. */ +static std::vector<RunConfiguration::AspectFactory> theAspectFactories; + RunConfiguration::RunConfiguration(Target *target, Core::Id id) : ProjectConfiguration(target, id) { Q_ASSERT(target); ctor(); - addExtraAspects(); + for (const AspectFactory &factory : theAspectFactories) + addExtraAspect(factory(this)); } RunConfiguration::RunConfiguration(Target *target, RunConfiguration *source) : @@ -209,10 +212,9 @@ RunConfiguration::~RunConfiguration() qDeleteAll(m_aspects); } -void RunConfiguration::addExtraAspects() +void RunConfiguration::addAspectFactory(const AspectFactory &aspectFactory) { - foreach (IRunControlFactory *factory, ExtensionSystem::PluginManager::getObjects<IRunControlFactory>()) - addExtraAspect(factory->createRunConfigurationAspect(this)); + theAspectFactories.push_back(aspectFactory); } void RunConfiguration::addExtraAspect(IRunConfigurationAspect *aspect) @@ -365,7 +367,7 @@ IRunConfigurationAspect *RunConfiguration::extraAspect(Core::Id id) const A target specific \l RunConfiguration implementation can specify what information it considers necessary to execute a process - on the target. Target specific) \n IRunControlFactory implementation + on the target. Target specific) \n RunWorker implementation can use that information either unmodified or tweak it or ignore it when setting up a RunControl. @@ -471,29 +473,6 @@ QList<IRunConfigurationFactory *> IRunConfigurationFactory::find(Target *parent) }); } -/*! - \class ProjectExplorer::IRunControlFactory - - \brief The IRunControlFactory class creates RunControl objects matching a - run configuration. -*/ - -/*! - \fn RunConfigWidget *ProjectExplorer::IRunConfigurationAspect::createConfigurationWidget() - - Returns a widget used to configure this runner. Ownership is transferred to - the caller. - - Returns null if @p \a runConfiguration is not suitable for RunControls from this - factory, or no user-accessible - configuration is required. -*/ - -IRunControlFactory::IRunControlFactory(QObject *parent) - : QObject(parent) -{ -} - using WorkerFactories = std::vector<RunControl::WorkerFactory>; static WorkerFactories &theWorkerFactories() @@ -504,50 +483,13 @@ static WorkerFactories &theWorkerFactories() bool RunControl::WorkerFactory::canRun(RunConfiguration *runConfiguration, Core::Id runMode) const { - if (runMode != runMode) + if (runMode != this->runMode) return false; if (!constraint) return true; return constraint(runConfiguration); } -bool IRunControlFactory::canRun(RunConfiguration *runConfiguration, Core::Id runMode) const -{ - for (const RunControl::WorkerFactory &factory : theWorkerFactories()) { - if (factory.canRun(runConfiguration, runMode)) - return true; - }; - return false; -} - -RunControl *IRunControlFactory::create(RunConfiguration *runConfiguration, Core::Id runMode, QString *) -{ - for (const RunControl::WorkerFactory &factory : theWorkerFactories()) { - if (factory.canRun(runConfiguration, runMode)) { - auto runControl = new RunControl(runConfiguration, runMode); - factory.producer(runControl); - return runControl; - } - }; - return nullptr; -} - -/*! - Returns an IRunConfigurationAspect to carry options for RunControls this - factory can create. - - If no extra options are required, it is allowed to return null like the - default implementation does. This function is intended to be called from the - RunConfiguration constructor, so passing a RunConfiguration pointer makes - no sense because that object is under construction at the time. -*/ - -IRunConfigurationAspect *IRunControlFactory::createRunConfigurationAspect(RunConfiguration *rc) -{ - Q_UNUSED(rc); - return nullptr; -} - /*! \class ProjectExplorer::RunControl \brief The RunControl class instances represent one item that is run. @@ -562,18 +504,6 @@ IRunConfigurationAspect *IRunControlFactory::createRunConfigurationAspect(RunCon */ -const char PRIORITY_KEY[] = "RunControlFactoryPriority"; - -int ProjectExplorer::IRunControlFactory::priority() const -{ - return property(PRIORITY_KEY).toInt(); // 0 by default. -} - -void IRunControlFactory::setPriority(int priority) -{ - setProperty(PRIORITY_KEY, priority); -} - namespace Internal { enum class RunWorkerState @@ -592,7 +522,7 @@ static QString stateName(RunWorkerState s) SN(RunWorkerState::Done) SN(RunWorkerState::Failed) } - return QLatin1String("<unknown>"); + return QString("<unknown: %1>").arg(int(s)); # undef SN } @@ -606,7 +536,7 @@ public: RunWorker *q; RunWorkerState state = RunWorkerState::Initialized; - RunControl *runControl; + QPointer<RunControl> runControl; QList<RunWorker *> dependencies; QString id; @@ -625,6 +555,8 @@ enum class RunControlState Running, // All good and running. Stopping, // initiateStop() was called, stop application/tool Stopped, // all good, but stopped. Can possibly be re-started + Finishing, // Application tab manually closed + Finished // Final state, will self-destruct with deleteLater() }; static QString stateName(RunControlState s) @@ -636,8 +568,10 @@ static QString stateName(RunControlState s) SN(RunControlState::Running) SN(RunControlState::Stopping) SN(RunControlState::Stopped) + SN(RunControlState::Finishing) + SN(RunControlState::Finished) } - return QLatin1String("<unknown>"); + return QString("<unknown: %1>").arg(int(s)); # undef SN } @@ -659,8 +593,11 @@ public: ~RunControlPrivate() { - QTC_CHECK(state == RunControlState::Stopped || state == RunControlState::Initialized); + QTC_CHECK(state == RunControlState::Finished || state == RunControlState::Initialized); + disconnect(); + q = nullptr; qDeleteAll(m_workers); + m_workers.clear(); delete outputFormatter; } @@ -675,7 +612,7 @@ public: void initiateReStart(); void continueStart(); void initiateStop(); - void continueStop(); + void initiateFinish(); void onWorkerStarted(RunWorker *worker); void onWorkerStopped(RunWorker *worker); @@ -694,7 +631,7 @@ public: Utils::Icon icon; const QPointer<RunConfiguration> runConfiguration; // Not owned. QPointer<Project> project; // Not owned. - Utils::OutputFormatter *outputFormatter = nullptr; + QPointer<Utils::OutputFormatter> outputFormatter = nullptr; std::function<bool(bool*)> promptToStop; std::vector<RunControl::WorkerFactory> m_factories; @@ -759,6 +696,11 @@ void RunControl::initiateStop() d->initiateStop(); } +void RunControl::initiateFinish() +{ + d->initiateFinish(); +} + using WorkerCreators = QHash<Core::Id, RunControl::WorkerCreator>; static WorkerCreators &theWorkerCreators() @@ -789,12 +731,22 @@ RunWorker *RunControl::createWorker(Core::Id id) RunControl::WorkerCreator RunControl::producer(RunConfiguration *runConfiguration, Core::Id runMode) { - for (const auto &factory : theWorkerFactories()) { - if (factory.runMode == runMode - && (!factory.constraint || factory.constraint(runConfiguration))) - return factory.producer; + WorkerFactories candidates; + for (const RunControl::WorkerFactory &factory : theWorkerFactories()) { + if (factory.canRun(runConfiguration, runMode)) + candidates.push_back(factory); + } + + if (candidates.empty()) + return {}; + + RunControl::WorkerFactory bestFactory = *candidates.begin(); + for (const RunControl::WorkerFactory &factory : candidates) { + if (factory.priority > bestFactory.priority) + bestFactory = factory; } - return {}; + + return bestFactory.producer; } void RunControl::addWorkerFactory(const RunControl::WorkerFactory &workerFactory) @@ -880,15 +832,58 @@ void RunControlPrivate::initiateStop() { checkState(RunControlState::Running); setState(RunControlState::Stopping); - debugMessage("Queue: Stopping"); + debugMessage("Queue: Stopping for all workers"); - continueStop(); + bool allDone = true; + for (RunWorker *worker : m_workers) { + if (worker) { + const QString &workerId = worker->d->id; + debugMessage(" Examining worker " + workerId); + switch (worker->d->state) { + case RunWorkerState::Initialized: + debugMessage(" " + workerId + " was Initialized, setting to Done"); + worker->d->state = RunWorkerState::Done; + break; + case RunWorkerState::Stopping: + debugMessage(" " + workerId + " was already Stopping. Keeping it that way"); + allDone = false; + break; + case RunWorkerState::Starting: + debugMessage(" " + workerId + " was Starting, queuing stop"); + worker->d->state = RunWorkerState::Stopping; + QTimer::singleShot(0, worker, &RunWorker::initiateStop); + allDone = false; + break; + case RunWorkerState::Running: + debugMessage(" " + workerId + " was Running, queuing stop"); + worker->d->state = RunWorkerState::Stopping; + allDone = false; + QTimer::singleShot(0, worker, &RunWorker::initiateStop); + break; + case RunWorkerState::Done: + debugMessage(" " + workerId + " was Done. Good."); + break; + case RunWorkerState::Failed: + debugMessage(" " + workerId + " was Failed. Good"); + break; + } + } else { + debugMessage("Found unknown deleted worker"); + } + } + if (allDone) { + debugMessage("All stopped."); + setState(RunControlState::Stopped); + } else { + debugMessage("Not all workers stopped. Waiting..."); + } } -void RunControlPrivate::continueStop() +void RunControlPrivate::initiateFinish() { - debugMessage("Continue Stopping"); - checkState(RunControlState::Stopping); + setState(RunControlState::Finishing); + debugMessage("Ramping down"); + bool allDone = true; for (RunWorker *worker : m_workers) { if (worker) { @@ -904,17 +899,17 @@ void RunControlPrivate::continueStop() allDone = false; break; case RunWorkerState::Starting: - worker->d->state = RunWorkerState::Stopping; debugMessage(" " + workerId + " was Starting, queuing stop"); - allDone = false; + worker->d->state = RunWorkerState::Stopping; QTimer::singleShot(0, worker, &RunWorker::initiateStop); - return; // Sic. + allDone = false; + break; case RunWorkerState::Running: debugMessage(" " + workerId + " was Running, queuing stop"); worker->d->state = RunWorkerState::Stopping; allDone = false; QTimer::singleShot(0, worker, &RunWorker::initiateStop); - return; // Sic. + break; case RunWorkerState::Done: debugMessage(" " + workerId + " was Done. Good."); break; @@ -927,8 +922,9 @@ void RunControlPrivate::continueStop() } } if (allDone) { - debugMessage("All workers stopped. Set runControl to Stopped"); - setState(RunControlState::Stopped); + setState(RunControlState::Finished); + } else { + debugMessage("Not all workers finished. Waiting..."); } } @@ -944,7 +940,6 @@ void RunControlPrivate::onWorkerStarted(RunWorker *worker) showError(tr("Unexpected run control state %1 when worker %2 started") .arg(stateName(state)) .arg(worker->d->id)); - //setState(RunControlState::Stopped); } void RunControlPrivate::onWorkerFailed(RunWorker *worker, const QString &msg) @@ -968,13 +963,72 @@ void RunControlPrivate::onWorkerStopped(RunWorker *worker) worker->d->state = RunWorkerState::Done; debugMessage(workerId + " stopped expectedly."); break; + case RunWorkerState::Done: + worker->d->state = RunWorkerState::Done; + debugMessage(workerId + " stopped twice. Huh? But harmless."); + return; // Sic! default: debugMessage(workerId + " stopped unexpectedly in state" + stateName(worker->d->state)); worker->d->state = RunWorkerState::Failed; break; } - continueStop(); + + debugMessage("Checking whether all stopped"); + bool allDone = true; + for (RunWorker *worker : m_workers) { + if (worker) { + const QString &workerId = worker->d->id; + debugMessage(" Examining worker " + workerId); + switch (worker->d->state) { + case RunWorkerState::Initialized: + debugMessage(" " + workerId + " was Initialized, setting to Done"); + worker->d->state = RunWorkerState::Done; + break; + case RunWorkerState::Starting: + worker->d->state = RunWorkerState::Stopping; + debugMessage(" " + workerId + " was Starting, queuing stop"); + allDone = false; + break; + case RunWorkerState::Running: + debugMessage(" " + workerId + " was Running, queuing stop"); + worker->d->state = RunWorkerState::Stopping; + allDone = false; + break; + case RunWorkerState::Stopping: + debugMessage(" " + workerId + " was already Stopping. Keeping it that way"); + allDone = false; + break; + case RunWorkerState::Done: + debugMessage(" " + workerId + " was Done. Good."); + break; + case RunWorkerState::Failed: + debugMessage(" " + workerId + " was Failed. Good"); + break; + } + } else { + debugMessage("Found unknown deleted worker"); + } + } + if (state == RunControlState::Finishing) { + if (allDone) { + debugMessage("All finished. Deleting myself"); + setState(RunControlState::Finished); + } else { + debugMessage("Not all workers finished. Waiting..."); + } + } else { + if (allDone) { + if (state == RunControlState::Stopped) { + debugMessage("All workers stopped, but runControl was already stopped."); + } else { + debugMessage("All workers stopped. Set runControl to Stopped"); + setState(RunControlState::Stopped); + } + } else { + debugMessage("Not all workers stopped. Waiting..."); + } + } } void RunControlPrivate::showError(const QString &msg) @@ -1175,15 +1229,23 @@ bool RunControlPrivate::isAllowedTransition(RunControlState from, RunControlStat { switch (from) { case RunControlState::Initialized: - return to == RunControlState::Starting; + return to == RunControlState::Starting + || to == RunControlState::Finishing; case RunControlState::Starting: - return to == RunControlState::Running; + return to == RunControlState::Running + || to == RunControlState::Finishing; case RunControlState::Running: return to == RunControlState::Stopping - || to == RunControlState::Stopped; + || to == RunControlState::Stopped + || to == RunControlState::Finishing; case RunControlState::Stopping: - return to == RunControlState::Stopped; + return to == RunControlState::Stopped + || to == RunControlState::Finishing; case RunControlState::Stopped: + return to == RunControlState::Finishing; + case RunControlState::Finishing: + return to == RunControlState::Finished; + case RunControlState::Finished: return false; } return false; @@ -1213,11 +1275,13 @@ void RunControlPrivate::setState(RunControlState newState) break; case RunControlState::Stopped: q->setApplicationProcessHandle(Utils::ProcessHandle()); - foreach (auto worker, m_workers) - if (worker) - worker->onFinished(); emit q->stopped(); break; + case RunControlState::Finished: + emit q->finished(); + debugMessage("All finished. Deleting myself"); + deleteLater(); + break; default: break; } @@ -1228,18 +1292,6 @@ void RunControlPrivate::debugMessage(const QString &msg) qCDebug(statesLog()) << msg; } -/*! - Brings the application determined by this RunControl's \c applicationProcessHandle - to the foreground. - - The default implementation raises the application on Mac, and does - nothing elsewhere. -*/ -void RunControl::bringApplicationToForeground() -{ - d->applicationProcessHandle.activate(); -} - void RunControl::appendMessage(const QString &msg, Utils::OutputFormat format) { emit appendMessageRequested(this, msg, format); @@ -1358,8 +1410,9 @@ void SimpleTargetRunner::stop() void SimpleTargetRunner::onProcessStarted() { // Console processes only know their pid after being started - runControl()->setApplicationProcessHandle(m_launcher.applicationPID()); - runControl()->bringApplicationToForeground(); + ProcessHandle pid = m_launcher.applicationPID(); + runControl()->setApplicationProcessHandle(pid); + pid.activate(); reportStarted(); } diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index eb408c204a..8fabadb654 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -245,6 +245,12 @@ public: static RunConfiguration *startupRunConfiguration(); + using AspectFactory = std::function<IRunConfigurationAspect *(RunConfiguration *)>; + template <class T> static void registerAspect() + { + addAspectFactory([](RunConfiguration *rc) { return new T(rc); }); + } + signals: void enabledChanged(); void requestRunActionsUpdate(); @@ -260,7 +266,7 @@ protected: private: void ctor(); - void addExtraAspects(); + static void addAspectFactory(const AspectFactory &aspectFactory); QList<IRunConfigurationAspect *> m_aspects; }; @@ -295,22 +301,6 @@ private: virtual RunConfiguration *doRestore(Target *parent, const QVariantMap &map) = 0; }; -class PROJECTEXPLORER_EXPORT IRunControlFactory : public QObject -{ - Q_OBJECT -public: - explicit IRunControlFactory(QObject *parent = nullptr); - - virtual bool canRun(RunConfiguration *runConfiguration, Core::Id runMode) const; - virtual RunControl *create(RunConfiguration *runConfiguration, Core::Id runMode, QString *errorMessage); - - virtual IRunConfigurationAspect *createRunConfigurationAspect(RunConfiguration *rc); - - int priority() const; -protected: - void setPriority(int priority); // Higher values will be preferred. -}; - class PROJECTEXPLORER_EXPORT RunConfigWidget : public QWidget { Q_OBJECT @@ -397,6 +387,7 @@ public: void initiateStart(); void initiateReStart(); void initiateStop(); + void initiateFinish(); bool promptToStop(bool *optionalPrompt = nullptr) const; void setPromptToStop(const std::function<bool(bool *)> &promptToStop); @@ -430,7 +421,6 @@ public: void setRunnable(const Runnable &runnable); virtual void appendMessage(const QString &msg, Utils::OutputFormat format); - virtual void bringApplicationToForeground(); static bool showPromptToStopDialog(const QString &title, const QString &text, const QString &stopButtonText = QString(), @@ -450,24 +440,28 @@ public: addWorkerFactory({runMode, constraint, producer}); } template <class Worker> - static void registerWorker(Core::Id runMode, const Constraint &constraint) + static void registerWorker(Core::Id runMode, const Constraint &constraint, int priority = 0) { auto producer = [](RunControl *rc) { return new Worker(rc); }; - addWorkerFactory({runMode, constraint, producer}); + addWorkerFactory({runMode, constraint, producer, priority}); } template <class Config, class Worker> - static void registerWorker(Core::Id runMode) + static void registerWorker(Core::Id runMode, int priority = 0) { auto constraint = [](RunConfiguration *runConfig) { return qobject_cast<Config *>(runConfig); }; auto producer = [](RunControl *rc) { return new Worker(rc); }; - addWorkerFactory({runMode, constraint, producer}); + addWorkerFactory({runMode, constraint, producer, priority}); } struct WorkerFactory { Core::Id runMode; Constraint constraint; WorkerCreator producer; + int priority = 0; + WorkerFactory(const Core::Id &mode, Constraint constr, const WorkerCreator &prod, + int prio = 0) + : runMode(mode), constraint(constr), producer(prod), priority(prio) {} bool canRun(RunConfiguration *runConfiguration, Core::Id runMode) const; }; @@ -479,6 +473,7 @@ signals: void aboutToStart(); void started(); void stopped(); + void finished(); void applicationProcessHandleChanged(QPrivateSignal); // Use setApplicationProcessHandle private: |