diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2022-01-28 14:08:35 +0100 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2022-01-31 09:32:11 +0000 |
commit | f7c9dac3a797543bf03abf95e8e773a9ca081358 (patch) | |
tree | 8c0087f7133d5599fe0ef9309726a92f82dce19f /src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp | |
parent | d48a4bd60f8983e2e3d9fa5359128720aff521d2 (diff) |
SshDeviceProcess: Don't store exitCode
Change-Id: Id957dc7b0e71d0d1376716cb2b63c83d43cc1a14
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp')
-rw-r--r-- | src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp b/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp index e496ffaa32..1386c7a630 100644 --- a/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp +++ b/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp @@ -58,7 +58,6 @@ public: QProcess::ExitStatus exitStatus = QProcess::NormalExit; DeviceProcessSignalOperation::Ptr killOperation; QTimer killTimer; - int exitCode = -1; enum State { Inactive, Connecting, Connected, ProcessRunning } state = Inactive; void setState(State newState); @@ -89,7 +88,6 @@ void SshDeviceProcess::start(const Runnable &runnable) d->setState(SshDeviceProcessPrivate::Connecting); d->errorMessage.clear(); - d->exitCode = -1; d->exitStatus = QProcess::NormalExit; d->runnable = runnable; QSsh::SshConnectionParameters params = device()->sshParameters(); @@ -145,13 +143,13 @@ QProcess::ProcessState SshDeviceProcess::state() const QProcess::ExitStatus SshDeviceProcess::exitStatus() const { - return d->exitStatus == QProcess::NormalExit && d->exitCode != 255 + return d->exitStatus == QProcess::NormalExit && exitCode() != 255 ? QProcess::NormalExit : QProcess::CrashExit; } int SshDeviceProcess::exitCode() const { - return d->exitCode; + return runInTerminal() ? QtcProcess::exitCode() : d->remoteProcess->exitCode(); } QString SshDeviceProcess::errorString() const @@ -241,7 +239,6 @@ void SshDeviceProcess::handleProcessStarted() void SshDeviceProcess::handleProcessFinished(const QString &error) { d->errorMessage = error; - d->exitCode = runInTerminal() ? QtcProcess::exitCode() : d->remoteProcess->exitCode(); if (d->killOperation && error.isEmpty()) d->errorMessage = tr("The process was ended forcefully."); d->setState(SshDeviceProcessPrivate::Inactive); |