From ada4429bcb221de860b2c6411ffa6938534981b1 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 5 Jul 2023 09:52:05 +0200 Subject: [PATCH] RemoteLinux: Simplify GenericDirectUploadStep The IncrementalDeployment::NotSupported was alwasy overridden with Enabled or Disabled before actual action started, so it was not more than a bool. Change-Id: Ia4e986d08cdd10e20a741868ecb43e0c7ed4bf33 Reviewed-by: Jarek Kobus --- src/plugins/remotelinux/genericdirectuploadstep.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/plugins/remotelinux/genericdirectuploadstep.cpp b/src/plugins/remotelinux/genericdirectuploadstep.cpp index 7797afc3c89..b11ce62e9f1 100644 --- a/src/plugins/remotelinux/genericdirectuploadstep.cpp +++ b/src/plugins/remotelinux/genericdirectuploadstep.cpp @@ -34,8 +34,6 @@ struct UploadStorage QList filesToUpload; }; -enum class IncrementalDeployment { Enabled, Disabled, NotSupported }; - class GenericDirectUploadStep : public AbstractRemoteLinuxDeployStep { public: @@ -52,8 +50,6 @@ public: ignoreMissingFiles.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox); setInternalInitializer([this] { - m_incremental = incremental() - ? IncrementalDeployment::Enabled : IncrementalDeployment::Disabled; return isDeploymentPossible(); }); @@ -78,7 +74,6 @@ public: GroupItem chmodTask(const DeployableFile &file); GroupItem chmodTree(const TreeStorage &storage); - IncrementalDeployment m_incremental = IncrementalDeployment::NotSupported; mutable QList m_deployableFiles; BoolAspect incremental{this}; @@ -268,12 +263,10 @@ Group GenericDirectUploadStep::deployRecipe() const auto preFilesToStat = [this](UploadStorage *storage) { QList filesToStat; for (const DeployableFile &file : std::as_const(m_deployableFiles)) { - if (m_incremental != IncrementalDeployment::Enabled || hasLocalFileChanged(file)) { + if (!incremental() || hasLocalFileChanged(file)) { storage->filesToUpload.append(file); continue; } - if (m_incremental == IncrementalDeployment::NotSupported) - continue; filesToStat << file; } return filesToStat; @@ -285,8 +278,7 @@ Group GenericDirectUploadStep::deployRecipe() }; const auto postFilesToStat = [this](UploadStorage *storage) { - return m_incremental == IncrementalDeployment::NotSupported - ? QList() : storage->filesToUpload; + return storage->filesToUpload; }; const auto postStatEndHandler = [this](UploadStorage *storage, const DeployableFile &file, const QDateTime ×tamp) {