aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp')
-rw-r--r--src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp43
1 files changed, 27 insertions, 16 deletions
diff --git a/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp b/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp
index 8cacd63ff91..94bfbfb981f 100644
--- a/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp
+++ b/src/plugins/remotelinux/remotelinuxdeployconfiguration.cpp
@@ -3,19 +3,38 @@
#include "remotelinuxdeployconfiguration.h"
-#include "makeinstallstep.h"
#include "remotelinux_constants.h"
#include "remotelinuxtr.h"
+#include <projectexplorer/devicesupport/filetransferinterface.h>
#include <projectexplorer/devicesupport/idevice.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/project.h>
+#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
using namespace ProjectExplorer;
namespace RemoteLinux::Internal {
+FileTransferMethod defaultTransferMethod(Kit *kit)
+{
+ auto runDevice = DeviceKitAspect::device(kit);
+ auto buildDevice = BuildDeviceKitAspect::device(kit);
+
+ if (runDevice != buildDevice) {
+ // FIXME: That's not the full truth, we need support from the build
+ // device, too.
+ if (runDevice && runDevice->extraData(Constants::SupportsRSync).toBool())
+ return FileTransferMethod::Rsync;
+ }
+
+ if (runDevice && runDevice->extraData(Constants::SupportsSftp).toBool())
+ return FileTransferMethod::Sftp;
+
+ return FileTransferMethod::GenericCopy;
+}
+
RemoteLinuxDeployConfigurationFactory::RemoteLinuxDeployConfigurationFactory()
{
setConfigBaseId(RemoteLinux::Constants::DeployToGenericLinux);
@@ -32,31 +51,23 @@ RemoteLinuxDeployConfigurationFactory::RemoteLinuxDeployConfigurationFactory()
setPostRestore([needsMakeInstall](DeployConfiguration *dc, const QVariantMap &map) {
// 4.9 -> 4.10. See QTCREATORBUG-22689.
if (map.value("_checkMakeInstall").toBool() && needsMakeInstall(dc->target())) {
- auto step = new MakeInstallStep(dc->stepList(), MakeInstallStep::stepId());
- dc->stepList()->insertStep(0, step);
+ dc->stepList()->insertStep(0, Constants::MakeInstallStepId);
}
});
addInitialStep(Constants::MakeInstallStepId, needsMakeInstall);
addInitialStep(Constants::KillAppStepId);
- // Todo: Check: Instead of having two different steps here, have one
+ // Todo: Check: Instead of having three different steps here, have one
// and shift the logic into the implementation there?
addInitialStep(Constants::RsyncDeployStepId, [](Target *target) {
- auto runDevice = DeviceKitAspect::device(target->kit());
- auto buildDevice = BuildDeviceKitAspect::device(target->kit());
- if (runDevice == buildDevice)
- return false;
- // FIXME: That's not the full truth, we need support from the build
- // device, too.
- return runDevice && runDevice->extraData(Constants::SupportsRSync).toBool();
+ return defaultTransferMethod(target->kit()) == FileTransferMethod::Rsync;
});
addInitialStep(Constants::DirectUploadStepId, [](Target *target) {
- auto runDevice = DeviceKitAspect::device(target->kit());
- auto buildDevice = BuildDeviceKitAspect::device(target->kit());
- if (runDevice == buildDevice)
- return true;
- return runDevice && !runDevice->extraData(Constants::SupportsRSync).toBool();
+ return defaultTransferMethod(target->kit()) == FileTransferMethod::Sftp;
+ });
+ addInitialStep(ProjectExplorer::Constants::COPY_FILE_STEP, [](Target *target) {
+ return defaultTransferMethod(target->kit()) == FileTransferMethod::GenericCopy;
});
}