From dfbe37542dd4db494bdad7d551c5d35b2201873f Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 2 Jul 2024 14:22:20 +0200 Subject: [PATCH] RemoteLinux: Fix potentially wrong name of deploy tool ... in error messages. For instance, one could get "rsync crashed" when it was actually sftp, misleading the user. Change-Id: I42bcecb8ca21c899ace78eb1397d3e71f2a0bb78 Reviewed-by: Jarek Kobus --- .../projectexplorer/devicesupport/filetransfer.h | 1 + src/plugins/remotelinux/genericdeploystep.cpp | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/plugins/projectexplorer/devicesupport/filetransfer.h b/src/plugins/projectexplorer/devicesupport/filetransfer.h index 7ad6a5c5bc3..2d84351d55c 100644 --- a/src/plugins/projectexplorer/devicesupport/filetransfer.h +++ b/src/plugins/projectexplorer/devicesupport/filetransfer.h @@ -37,6 +37,7 @@ public: Utils::ProcessResultData resultData() const; static QString transferMethodName(FileTransferMethod method); + QString transferMethodName() const { return transferMethodName(transferMethod()); } signals: void progress(const QString &progressMessage); diff --git a/src/plugins/remotelinux/genericdeploystep.cpp b/src/plugins/remotelinux/genericdeploystep.cpp index 0002e69f5f2..cba80697f08 100644 --- a/src/plugins/remotelinux/genericdeploystep.cpp +++ b/src/plugins/remotelinux/genericdeploystep.cpp @@ -176,12 +176,16 @@ GroupItem GenericDeployStep::transferTask(const Storage &storag const auto onError = [this](const FileTransfer &transfer) { const ProcessResultData result = transfer.resultData(); if (result.m_error == QProcess::FailedToStart) { - addErrorMessage(Tr::tr("rsync failed to start: %1").arg(result.m_errorString)); + addErrorMessage(Tr::tr("%1 failed to start: %2") + .arg(transfer.transferMethodName(), result.m_errorString)); } else if (result.m_exitStatus == QProcess::CrashExit) { - addErrorMessage(Tr::tr("rsync crashed.")); + addErrorMessage(Tr::tr("%1 crashed.").arg(transfer.transferMethodName())); } else if (result.m_exitCode != 0) { - addErrorMessage(Tr::tr("rsync failed with exit code %1.").arg(result.m_exitCode) - + "\n" + result.m_errorString); + addErrorMessage( + Tr::tr("%1 failed with exit code %2.") + .arg(transfer.transferMethodName()) + .arg(result.m_exitCode) + + "\n" + result.m_errorString); } }; return FileTransferTask(onSetup, onError, CallDoneIf::Error);