From 25c33be9f4d420d2026ce02cb23c7e8b75df151a Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 5 Apr 2023 09:45:10 +0200 Subject: [PATCH] Boot2Qt: Switch deploy step creation to clone-by-id This finally cuts the compile-time dependency on individual factories or even step implementations. Change-Id: I764d489231762982dad803ce1cad9aca6352f1d9 Reviewed-by: Christian Kandeler Reviewed-by: --- src/plugins/boot2qt/qdbplugin.cpp | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/plugins/boot2qt/qdbplugin.cpp b/src/plugins/boot2qt/qdbplugin.cpp index 0d995ee0402..41fc79e2a25 100644 --- a/src/plugins/boot2qt/qdbplugin.cpp +++ b/src/plugins/boot2qt/qdbplugin.cpp @@ -27,9 +27,6 @@ #include -#include -#include -#include #include #include @@ -41,8 +38,7 @@ using namespace ProjectExplorer; using namespace Utils; -namespace Qdb { -namespace Internal { +namespace Qdb::Internal { static FilePath flashWizardFilePath() { @@ -100,14 +96,14 @@ void registerFlashAction(QObject *parentForAction) toolsContainer->addAction(flashCommand, flashActionId); } -template -class QdbDeployStepFactory : public Factory +class QdbDeployStepFactory : public BuildStepFactory { public: - QdbDeployStepFactory() + explicit QdbDeployStepFactory(Id existingStepId) { - Factory::setSupportedConfiguration(Constants::QdbDeployConfigurationId); - Factory::setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY); + cloneStep(existingStepId); + setSupportedConfiguration(Constants::QdbDeployConfigurationId); + setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY); } }; @@ -123,9 +119,9 @@ public: QdbStopApplicationStepFactory m_stopApplicationStepFactory; QdbMakeDefaultAppStepFactory m_makeDefaultAppStepFactory; - QdbDeployStepFactory m_directUploadStepFactory; - QdbDeployStepFactory m_rsyncDeployStepFactory; - QdbDeployStepFactory m_makeInstallStepFactory; + QdbDeployStepFactory m_directUploadStepFactory{RemoteLinux::Constants::DirectUploadStepId}; + QdbDeployStepFactory m_rsyncDeployStepFactory{RemoteLinux::Constants::RsyncDeployStepId}; + QdbDeployStepFactory m_makeInstallStepFactory{RemoteLinux::Constants::MakeInstallStepId}; const QList supportedRunConfigs { m_runConfigFactory.runConfigurationId(), @@ -175,5 +171,4 @@ void QdbPluginPrivate::setupDeviceDetection() m_deviceDetector.start(); } -} // Internal -} // Qdb +} // Qdb::Internal