diff --git a/src/plugins/remotelinux/CMakeLists.txt b/src/plugins/remotelinux/CMakeLists.txt index a29886139c0..563d2c5ad9a 100644 --- a/src/plugins/remotelinux/CMakeLists.txt +++ b/src/plugins/remotelinux/CMakeLists.txt @@ -5,6 +5,7 @@ add_qtc_plugin(RemoteLinux abstractpackagingstep.cpp abstractpackagingstep.h abstractremotelinuxdeployservice.cpp abstractremotelinuxdeployservice.h abstractremotelinuxdeploystep.cpp abstractremotelinuxdeploystep.h + customcommanddeploystep.cpp customcommanddeploystep.h deploymenttimeinfo.cpp deploymenttimeinfo.h genericdirectuploadservice.cpp genericdirectuploadservice.h genericdirectuploadstep.cpp genericdirectuploadstep.h @@ -22,7 +23,6 @@ add_qtc_plugin(RemoteLinux remotelinux_constants.h remotelinux_export.h remotelinuxcheckforfreediskspacestep.cpp remotelinuxcheckforfreediskspacestep.h - remotelinuxcustomcommanddeploymentstep.cpp remotelinuxcustomcommanddeploymentstep.h remotelinuxcustomrunconfiguration.cpp remotelinuxcustomrunconfiguration.h remotelinuxdebugsupport.cpp remotelinuxdebugsupport.h remotelinuxdeployconfiguration.cpp remotelinuxdeployconfiguration.h diff --git a/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp b/src/plugins/remotelinux/customcommanddeploystep.cpp similarity index 77% rename from src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp rename to src/plugins/remotelinux/customcommanddeploystep.cpp index b9054f3d724..6b5b91ef1cb 100644 --- a/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.cpp +++ b/src/plugins/remotelinux/customcommanddeploystep.cpp @@ -23,7 +23,7 @@ ** ****************************************************************************/ -#include "remotelinuxcustomcommanddeploymentstep.h" +#include "customcommanddeploystep.h" #include "remotelinux_constants.h" @@ -38,14 +38,12 @@ using namespace Utils; namespace RemoteLinux { namespace Internal { -// RemoteLinuxCustomCommandDeployService - -class RemoteLinuxCustomCommandDeployService : public AbstractRemoteLinuxDeployService +class CustomCommandDeployService : public AbstractRemoteLinuxDeployService { - Q_DECLARE_TR_FUNCTIONS(RemoteLinux::Internal::RemoteLinuxCustomCommandDeployService) + Q_DECLARE_TR_FUNCTIONS(RemoteLinux::Internal::CustomCommandDeployService) public: - RemoteLinuxCustomCommandDeployService(); + CustomCommandDeployService(); void setCommandLine(const QString &commandLine); @@ -60,7 +58,7 @@ protected: QtcProcess m_process; }; -RemoteLinuxCustomCommandDeployService::RemoteLinuxCustomCommandDeployService() +CustomCommandDeployService::CustomCommandDeployService() { connect(&m_process, &QtcProcess::readyReadStandardOutput, this, [this] { emit stdOutData(QString::fromUtf8(m_process.readAllStandardOutput())); @@ -82,12 +80,12 @@ RemoteLinuxCustomCommandDeployService::RemoteLinuxCustomCommandDeployService() }); } -void RemoteLinuxCustomCommandDeployService::setCommandLine(const QString &commandLine) +void CustomCommandDeployService::setCommandLine(const QString &commandLine) { m_commandLine = commandLine; } -CheckResult RemoteLinuxCustomCommandDeployService::isDeploymentPossible() const +CheckResult CustomCommandDeployService::isDeploymentPossible() const { if (m_commandLine.isEmpty()) return CheckResult::failure(tr("No command line given.")); @@ -95,7 +93,7 @@ CheckResult RemoteLinuxCustomCommandDeployService::isDeploymentPossible() const return AbstractRemoteLinuxDeployService::isDeploymentPossible(); } -void RemoteLinuxCustomCommandDeployService::doDeploy() +void CustomCommandDeployService::doDeploy() { emit progressMessage(tr("Starting remote command \"%1\"...").arg(m_commandLine)); m_process.setCommand({deviceConfiguration()->filePath("/bin/sh"), @@ -103,7 +101,7 @@ void RemoteLinuxCustomCommandDeployService::doDeploy() m_process.start(); } -void RemoteLinuxCustomCommandDeployService::stopDeployment() +void CustomCommandDeployService::stopDeployment() { m_process.close(); handleDeploymentDone(); @@ -111,14 +109,10 @@ void RemoteLinuxCustomCommandDeployService::stopDeployment() } // Internal - -// RemoteLinuxCustomCommandDeploymentStep - -RemoteLinuxCustomCommandDeploymentStep::RemoteLinuxCustomCommandDeploymentStep - (BuildStepList *bsl, Utils::Id id) +CustomCommandDeployStep::CustomCommandDeployStep(BuildStepList *bsl, Utils::Id id) : AbstractRemoteLinuxDeployStep(bsl, id) { - auto service = createDeployService(); + auto service = createDeployService(); auto commandLine = addAspect(); commandLine->setSettingsKey("RemoteLinuxCustomCommandDeploymentStep.CommandLine"); @@ -134,14 +128,12 @@ RemoteLinuxCustomCommandDeploymentStep::RemoteLinuxCustomCommandDeploymentStep addMacroExpander(); } -RemoteLinuxCustomCommandDeploymentStep::~RemoteLinuxCustomCommandDeploymentStep() = default; - -Utils::Id RemoteLinuxCustomCommandDeploymentStep::stepId() +Utils::Id CustomCommandDeployStep::stepId() { return Constants::CustomCommandDeployStepId; } -QString RemoteLinuxCustomCommandDeploymentStep::displayName() +QString CustomCommandDeployStep::displayName() { return tr("Run custom remote command"); } diff --git a/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.h b/src/plugins/remotelinux/customcommanddeploystep.h similarity index 84% rename from src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.h rename to src/plugins/remotelinux/customcommanddeploystep.h index 7200c201a0f..797fc90606d 100644 --- a/src/plugins/remotelinux/remotelinuxcustomcommanddeploymentstep.h +++ b/src/plugins/remotelinux/customcommanddeploystep.h @@ -29,14 +29,12 @@ namespace RemoteLinux { -class REMOTELINUX_EXPORT RemoteLinuxCustomCommandDeploymentStep - : public AbstractRemoteLinuxDeployStep +class REMOTELINUX_EXPORT CustomCommandDeployStep : public AbstractRemoteLinuxDeployStep { Q_OBJECT public: - RemoteLinuxCustomCommandDeploymentStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id); - ~RemoteLinuxCustomCommandDeploymentStep() override; + CustomCommandDeployStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id); static Utils::Id stepId(); static QString displayName(); diff --git a/src/plugins/remotelinux/remotelinux.qbs b/src/plugins/remotelinux/remotelinux.qbs index cdaf40f11a5..3ddf4537343 100644 --- a/src/plugins/remotelinux/remotelinux.qbs +++ b/src/plugins/remotelinux/remotelinux.qbs @@ -21,6 +21,8 @@ Project { "abstractremotelinuxdeploystep.h", "deploymenttimeinfo.cpp", "deploymenttimeinfo.h", + "customcommanddeploystep.cpp", + "customcommanddeploystep.h", "genericdirectuploadservice.cpp", "genericdirectuploadservice.h", "genericdirectuploadstep.cpp", @@ -49,8 +51,6 @@ Project { "remotelinux_export.h", "remotelinuxcheckforfreediskspacestep.cpp", "remotelinuxcheckforfreediskspacestep.h", - "remotelinuxcustomcommanddeploymentstep.cpp", - "remotelinuxcustomcommanddeploymentstep.h", "remotelinuxcustomrunconfiguration.cpp", "remotelinuxcustomrunconfiguration.h", "remotelinuxdebugsupport.cpp", diff --git a/src/plugins/remotelinux/remotelinuxplugin.cpp b/src/plugins/remotelinux/remotelinuxplugin.cpp index a4239ca2e72..1c1c6e01ff4 100644 --- a/src/plugins/remotelinux/remotelinuxplugin.cpp +++ b/src/plugins/remotelinux/remotelinuxplugin.cpp @@ -25,20 +25,19 @@ #include "remotelinuxplugin.h" +#include "customcommanddeploystep.h" +#include "genericdirectuploadstep.h" +#include "killappstep.h" #include "linuxdevice.h" +#include "makeinstallstep.h" #include "remotelinux_constants.h" +#include "remotelinuxcheckforfreediskspacestep.h" +#include "remotelinuxdeployconfiguration.h" #include "remotelinuxqmltoolingsupport.h" #include "remotelinuxcustomrunconfiguration.h" #include "remotelinuxdebugsupport.h" #include "remotelinuxdeployconfiguration.h" #include "remotelinuxrunconfiguration.h" - -#include "genericdirectuploadstep.h" -#include "makeinstallstep.h" -#include "remotelinuxcheckforfreediskspacestep.h" -#include "remotelinuxdeployconfiguration.h" -#include "remotelinuxcustomcommanddeploymentstep.h" -#include "killappstep.h" #include "rsyncdeploystep.h" #include "tarpackagecreationstep.h" #include "tarpackagedeploystep.h" @@ -79,8 +78,7 @@ public: GenericDeployStepFactory tarPackageDeployStepFactory; GenericDeployStepFactory genericDirectUploadStepFactory; GenericDeployStepFactory rsyncDeployStepFactory; - GenericDeployStepFactory - customCommandDeploymentStepFactory; + GenericDeployStepFactory customCommandDeployStepFactory; GenericDeployStepFactory checkForFreeDiskSpaceStepFactory; GenericDeployStepFactory killAppStepFactory;