forked from qt-creator/qt-creator
ProjectExplorer: Re-work setup runworker factories
This combines two of the previous three paths to create run workers, and refers to RunConfigurations by id, not by type where possible to decrease coupling between the classes. Only allow "type of run configuration" and "type of device" as the only possible kind of restriction and require a uniform RunWorker constructor signature. Adapt user code to fit that pattern. Change-Id: I5a6d49c9a144785fd0235d7586f244b56f67b366 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -110,6 +110,10 @@ public:
|
||||
PortsGatherer *m_portsGatherer;
|
||||
};
|
||||
|
||||
RunWorkerFactory::WorkerCreator makeEmrunWorker()
|
||||
{
|
||||
return RunWorkerFactory::make<EmrunRunWorker>();
|
||||
}
|
||||
|
||||
// Factories
|
||||
|
||||
@@ -120,12 +124,5 @@ EmrunRunConfigurationFactory::EmrunRunConfigurationFactory()
|
||||
addSupportedTargetDeviceType(Constants::WEBASSEMBLY_DEVICE_TYPE);
|
||||
}
|
||||
|
||||
EmrunRunWorkerFactory::EmrunRunWorkerFactory()
|
||||
{
|
||||
setProducer([](RunControl *rc) { return new EmrunRunWorker(rc); });
|
||||
addSupportedRunMode(ProjectExplorer::Constants::NORMAL_RUN_MODE);
|
||||
addSupportedRunConfiguration(Constants::WEBASSEMBLY_RUNCONFIGURATION_EMRUN);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Webassembly
|
||||
|
||||
Reference in New Issue
Block a user