WebAssembly: use a dedicated class to create EmrunRunWorker

Change-Id: Idbeece82d8b59f02148207b0459a76aae162bb51
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2023-01-06 14:32:11 +01:00
parent 57adf73a89
commit 82c1a3a934
4 changed files with 22 additions and 27 deletions

View File

@@ -25,8 +25,7 @@ using namespace Core;
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace Utils; using namespace Utils;
namespace WebAssembly { namespace WebAssembly::Internal {
namespace Internal {
class WebAssemblyPluginPrivate class WebAssemblyPluginPrivate
{ {
@@ -35,11 +34,7 @@ public:
WebAssemblyDeviceFactory deviceFactory; WebAssemblyDeviceFactory deviceFactory;
WebAssemblyQtVersionFactory qtVersionFactory; WebAssemblyQtVersionFactory qtVersionFactory;
EmrunRunConfigurationFactory emrunRunConfigurationFactory; EmrunRunConfigurationFactory emrunRunConfigurationFactory;
RunWorkerFactory emrunRunWorkerFactory{ EmrunRunWorkerFactory emrunRunWorkerFactory;
makeEmrunWorker(),
{ProjectExplorer::Constants::NORMAL_RUN_MODE},
{Constants::WEBASSEMBLY_RUNCONFIGURATION_EMRUN}
};
WebAssemblyOptionsPage optionsPage; WebAssemblyOptionsPage optionsPage;
}; };
@@ -94,5 +89,4 @@ void WebAssemblyPlugin::askUserAboutEmSdkSetup()
ICore::infoBar()->addInfo(info); ICore::infoBar()->addInfo(info);
} }
} // namespace Internal } // WebAssembly::Internal
} // namespace WebAssembly

View File

@@ -7,8 +7,7 @@
#include <extensionsystem/iplugin.h> #include <extensionsystem/iplugin.h>
namespace WebAssembly { namespace WebAssembly::Internal {
namespace Internal {
class WebAssemblyPlugin : public ExtensionSystem::IPlugin class WebAssemblyPlugin : public ExtensionSystem::IPlugin
{ {
@@ -32,5 +31,4 @@ private slots:
#endif // WITH_TESTS #endif // WITH_TESTS
}; };
} // namespace Internal } // WebAssembly::Internal
} // namespace WebAssembly

View File

@@ -11,14 +11,14 @@
#include <projectexplorer/devicesupport/devicemanager.h> #include <projectexplorer/devicesupport/devicemanager.h>
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h> #include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/runcontrol.h> #include <projectexplorer/runcontrol.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace Utils; using namespace Utils;
namespace WebAssembly { namespace WebAssembly::Internal {
namespace Internal {
static FilePath pythonInterpreter(const Environment &env) static FilePath pythonInterpreter(const Environment &env)
{ {
@@ -111,11 +111,6 @@ public:
} }
}; };
RunWorkerFactory::WorkerCreator makeEmrunWorker()
{
return RunWorkerFactory::make<EmrunRunWorker>();
}
// Factories // Factories
EmrunRunConfigurationFactory::EmrunRunConfigurationFactory() EmrunRunConfigurationFactory::EmrunRunConfigurationFactory()
@@ -124,5 +119,11 @@ EmrunRunConfigurationFactory::EmrunRunConfigurationFactory()
addSupportedTargetDeviceType(Constants::WEBASSEMBLY_DEVICE_TYPE); addSupportedTargetDeviceType(Constants::WEBASSEMBLY_DEVICE_TYPE);
} }
} // namespace Internal EmrunRunWorkerFactory::EmrunRunWorkerFactory()
} // namespace Webassembly {
setProduct<EmrunRunWorker>();
addSupportedRunMode(ProjectExplorer::Constants::NORMAL_RUN_MODE);
addSupportedRunConfig(Constants::WEBASSEMBLY_RUNCONFIGURATION_EMRUN);
}
} // Webassembly::Internal

View File

@@ -6,8 +6,7 @@
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
#include <projectexplorer/runcontrol.h> #include <projectexplorer/runcontrol.h>
namespace WebAssembly { namespace WebAssembly::Internal {
namespace Internal {
class EmrunRunConfigurationFactory final : public ProjectExplorer::RunConfigurationFactory class EmrunRunConfigurationFactory final : public ProjectExplorer::RunConfigurationFactory
{ {
@@ -15,7 +14,10 @@ public:
EmrunRunConfigurationFactory(); EmrunRunConfigurationFactory();
}; };
ProjectExplorer::RunWorkerFactory::WorkerCreator makeEmrunWorker(); class EmrunRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory
{
public:
EmrunRunWorkerFactory();
};
} // namespace Internal } // Webassembly::Internal
} // namespace Webassembly