diff options
author | hjk <hjk@qt.io> | 2023-01-06 14:32:11 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2023-01-10 12:18:12 +0000 |
commit | 82c1a3a934fce4c081ffea314ebe26a49021dcce (patch) | |
tree | cfc4c2ea679dc529c7084d1ed98bcfb5df6807b9 /src/plugins/webassembly | |
parent | 57adf73a893849a30d589148a05be2fcf9b18797 (diff) |
WebAssembly: use a dedicated class to create EmrunRunWorker
Change-Id: Idbeece82d8b59f02148207b0459a76aae162bb51
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/plugins/webassembly')
-rw-r--r-- | src/plugins/webassembly/webassemblyplugin.cpp | 12 | ||||
-rw-r--r-- | src/plugins/webassembly/webassemblyplugin.h | 6 | ||||
-rw-r--r-- | src/plugins/webassembly/webassemblyrunconfiguration.cpp | 19 | ||||
-rw-r--r-- | src/plugins/webassembly/webassemblyrunconfiguration.h | 12 |
4 files changed, 22 insertions, 27 deletions
diff --git a/src/plugins/webassembly/webassemblyplugin.cpp b/src/plugins/webassembly/webassemblyplugin.cpp index 4413b197d2..c0c05d20bd 100644 --- a/src/plugins/webassembly/webassemblyplugin.cpp +++ b/src/plugins/webassembly/webassemblyplugin.cpp @@ -25,8 +25,7 @@ using namespace Core; using namespace ProjectExplorer; using namespace Utils; -namespace WebAssembly { -namespace Internal { +namespace WebAssembly::Internal { class WebAssemblyPluginPrivate { @@ -35,11 +34,7 @@ public: WebAssemblyDeviceFactory deviceFactory; WebAssemblyQtVersionFactory qtVersionFactory; EmrunRunConfigurationFactory emrunRunConfigurationFactory; - RunWorkerFactory emrunRunWorkerFactory{ - makeEmrunWorker(), - {ProjectExplorer::Constants::NORMAL_RUN_MODE}, - {Constants::WEBASSEMBLY_RUNCONFIGURATION_EMRUN} - }; + EmrunRunWorkerFactory emrunRunWorkerFactory; WebAssemblyOptionsPage optionsPage; }; @@ -94,5 +89,4 @@ void WebAssemblyPlugin::askUserAboutEmSdkSetup() ICore::infoBar()->addInfo(info); } -} // namespace Internal -} // namespace WebAssembly +} // WebAssembly::Internal diff --git a/src/plugins/webassembly/webassemblyplugin.h b/src/plugins/webassembly/webassemblyplugin.h index 202cdcd6dd..40c5f8e487 100644 --- a/src/plugins/webassembly/webassemblyplugin.h +++ b/src/plugins/webassembly/webassemblyplugin.h @@ -7,8 +7,7 @@ #include <extensionsystem/iplugin.h> -namespace WebAssembly { -namespace Internal { +namespace WebAssembly::Internal { class WebAssemblyPlugin : public ExtensionSystem::IPlugin { @@ -32,5 +31,4 @@ private slots: #endif // WITH_TESTS }; -} // namespace Internal -} // namespace WebAssembly +} // WebAssembly::Internal diff --git a/src/plugins/webassembly/webassemblyrunconfiguration.cpp b/src/plugins/webassembly/webassemblyrunconfiguration.cpp index 994f9782fd..32f1bf581b 100644 --- a/src/plugins/webassembly/webassemblyrunconfiguration.cpp +++ b/src/plugins/webassembly/webassemblyrunconfiguration.cpp @@ -11,14 +11,14 @@ #include <projectexplorer/devicesupport/devicemanager.h> #include <projectexplorer/devicesupport/deviceusedportsgatherer.h> #include <projectexplorer/project.h> +#include <projectexplorer/projectexplorerconstants.h> #include <projectexplorer/runcontrol.h> #include <projectexplorer/target.h> using namespace ProjectExplorer; using namespace Utils; -namespace WebAssembly { -namespace Internal { +namespace WebAssembly::Internal { static FilePath pythonInterpreter(const Environment &env) { @@ -111,11 +111,6 @@ public: } }; -RunWorkerFactory::WorkerCreator makeEmrunWorker() -{ - return RunWorkerFactory::make<EmrunRunWorker>(); -} - // Factories EmrunRunConfigurationFactory::EmrunRunConfigurationFactory() @@ -124,5 +119,11 @@ EmrunRunConfigurationFactory::EmrunRunConfigurationFactory() addSupportedTargetDeviceType(Constants::WEBASSEMBLY_DEVICE_TYPE); } -} // namespace Internal -} // namespace Webassembly +EmrunRunWorkerFactory::EmrunRunWorkerFactory() +{ + setProduct<EmrunRunWorker>(); + addSupportedRunMode(ProjectExplorer::Constants::NORMAL_RUN_MODE); + addSupportedRunConfig(Constants::WEBASSEMBLY_RUNCONFIGURATION_EMRUN); +} + +} // Webassembly::Internal diff --git a/src/plugins/webassembly/webassemblyrunconfiguration.h b/src/plugins/webassembly/webassemblyrunconfiguration.h index 5dd4a7aec0..b6ade22e84 100644 --- a/src/plugins/webassembly/webassemblyrunconfiguration.h +++ b/src/plugins/webassembly/webassemblyrunconfiguration.h @@ -6,8 +6,7 @@ #include <projectexplorer/runconfiguration.h> #include <projectexplorer/runcontrol.h> -namespace WebAssembly { -namespace Internal { +namespace WebAssembly::Internal { class EmrunRunConfigurationFactory final : public ProjectExplorer::RunConfigurationFactory { @@ -15,7 +14,10 @@ public: EmrunRunConfigurationFactory(); }; -ProjectExplorer::RunWorkerFactory::WorkerCreator makeEmrunWorker(); +class EmrunRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory +{ +public: + EmrunRunWorkerFactory(); +}; -} // namespace Internal -} // namespace Webassembly +} // Webassembly::Internal |