forked from qt-creator/qt-creator
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 <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -37,6 +37,7 @@ public:
|
|||||||
Utils::ProcessResultData resultData() const;
|
Utils::ProcessResultData resultData() const;
|
||||||
|
|
||||||
static QString transferMethodName(FileTransferMethod method);
|
static QString transferMethodName(FileTransferMethod method);
|
||||||
|
QString transferMethodName() const { return transferMethodName(transferMethod()); }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void progress(const QString &progressMessage);
|
void progress(const QString &progressMessage);
|
||||||
|
@@ -176,12 +176,16 @@ GroupItem GenericDeployStep::transferTask(const Storage<FilesToTransfer> &storag
|
|||||||
const auto onError = [this](const FileTransfer &transfer) {
|
const auto onError = [this](const FileTransfer &transfer) {
|
||||||
const ProcessResultData result = transfer.resultData();
|
const ProcessResultData result = transfer.resultData();
|
||||||
if (result.m_error == QProcess::FailedToStart) {
|
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) {
|
} 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) {
|
} else if (result.m_exitCode != 0) {
|
||||||
addErrorMessage(Tr::tr("rsync failed with exit code %1.").arg(result.m_exitCode)
|
addErrorMessage(
|
||||||
+ "\n" + result.m_errorString);
|
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);
|
return FileTransferTask(onSetup, onError, CallDoneIf::Error);
|
||||||
|
Reference in New Issue
Block a user