forked from qt-creator/qt-creator
McuSupport: use a dedicated class to create flash run worker
Change-Id: I26a403755f2ae57a43bbac2439359831a8d59431 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -53,9 +53,7 @@ class McuSupportPluginPrivate
|
||||
public:
|
||||
McuSupportDeviceFactory deviceFactory;
|
||||
McuSupportRunConfigurationFactory runConfigurationFactory;
|
||||
RunWorkerFactory runWorkerFactory{makeFlashAndRunWorker(),
|
||||
{ProjectExplorer::Constants::NORMAL_RUN_MODE},
|
||||
{Constants::RUNCONFIGURATION}};
|
||||
FlashRunWorkerFactory flashRunWorkerFactory;
|
||||
SettingsHandler::Ptr m_settingsHandler{new SettingsHandler};
|
||||
McuSupportOptions m_options{m_settingsHandler};
|
||||
McuSupportOptionsPage optionsPage{m_options, m_settingsHandler};
|
||||
|
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <cmakeprojectmanager/cmakekitinformation.h>
|
||||
@@ -16,8 +17,7 @@
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace McuSupport {
|
||||
namespace Internal {
|
||||
namespace McuSupport::Internal {
|
||||
|
||||
static FilePath cmakeFilePath(const Target *target)
|
||||
{
|
||||
@@ -76,17 +76,19 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
RunWorkerFactory::WorkerCreator makeFlashAndRunWorker()
|
||||
{
|
||||
return RunWorkerFactory::make<FlashAndRunWorker>();
|
||||
}
|
||||
// Factories
|
||||
|
||||
McuSupportRunConfigurationFactory::McuSupportRunConfigurationFactory()
|
||||
: RunConfigurationFactory()
|
||||
{
|
||||
registerRunConfiguration<FlashAndRunConfiguration>(Constants::RUNCONFIGURATION);
|
||||
addSupportedTargetDeviceType(Constants::DEVICE_TYPE);
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace McuSupport
|
||||
FlashRunWorkerFactory::FlashRunWorkerFactory()
|
||||
{
|
||||
setProduct<FlashAndRunWorker>();
|
||||
addSupportedRunMode(ProjectExplorer::Constants::NORMAL_RUN_MODE);
|
||||
addSupportedRunConfig(Constants::RUNCONFIGURATION);
|
||||
}
|
||||
|
||||
} // McuSupport::Internal
|
||||
|
@@ -3,11 +3,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
#include <projectexplorer/runcontrol.h>
|
||||
|
||||
namespace McuSupport {
|
||||
namespace Internal {
|
||||
namespace McuSupport::Internal {
|
||||
|
||||
class McuSupportRunConfigurationFactory final : public ProjectExplorer::RunConfigurationFactory
|
||||
{
|
||||
@@ -15,7 +13,10 @@ public:
|
||||
McuSupportRunConfigurationFactory();
|
||||
};
|
||||
|
||||
ProjectExplorer::RunWorkerFactory::WorkerCreator makeFlashAndRunWorker();
|
||||
class FlashRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory
|
||||
{
|
||||
public:
|
||||
FlashRunWorkerFactory();
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace McuSupport
|
||||
} // McuSupport::Internal
|
||||
|
Reference in New Issue
Block a user