diff options
-rw-r--r-- | src/libs/ssh/sshremoteprocess.cpp | 7 | ||||
-rw-r--r-- | src/libs/ssh/sshremoteprocess.h | 2 | ||||
-rw-r--r-- | src/libs/ssh/sshremoteprocessrunner.cpp | 4 | ||||
-rw-r--r-- | src/libs/ssh/sshremoteprocessrunner.h | 2 | ||||
-rw-r--r-- | src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp | 5 | ||||
-rw-r--r-- | src/plugins/remotelinux/genericdirectuploadservice.cpp | 9 | ||||
-rw-r--r-- | src/plugins/remotelinux/linuxdevicetester.cpp | 4 | ||||
-rw-r--r-- | src/plugins/remotelinux/linuxdevicetester.h | 2 | ||||
-rw-r--r-- | src/plugins/remotelinux/rsyncdeploystep.cpp | 3 | ||||
-rw-r--r-- | tests/manual/ssh/shell/shell.cpp | 4 | ||||
-rw-r--r-- | tests/manual/ssh/shell/shell.h | 2 |
11 files changed, 22 insertions, 22 deletions
diff --git a/src/libs/ssh/sshremoteprocess.cpp b/src/libs/ssh/sshremoteprocess.cpp index 13b40ff72e..98cbcf9600 100644 --- a/src/libs/ssh/sshremoteprocess.cpp +++ b/src/libs/ssh/sshremoteprocess.cpp @@ -58,14 +58,13 @@ SshRemoteProcess::SshRemoteProcess(const QString &command, const QStringList &co m_connectionArgs = connectionArgs; connect(this, &QtcProcess::finished, this, [this] { - QString error; if (exitStatus() == QProcess::CrashExit) - error = tr("The ssh process crashed: %1").arg(errorString()); - emit done(error); + setErrorString(tr("The ssh process crashed: %1").arg(errorString())); + emit done(); }); connect(this, &QtcProcess::errorOccurred, [this](QProcess::ProcessError error) { if (error == QProcess::FailedToStart) - emit done(errorString()); + emit done(); }); } diff --git a/src/libs/ssh/sshremoteprocess.h b/src/libs/ssh/sshremoteprocess.h index 5fbe2da930..4f9deab6b3 100644 --- a/src/libs/ssh/sshremoteprocess.h +++ b/src/libs/ssh/sshremoteprocess.h @@ -48,7 +48,7 @@ public: static bool setupSshEnvironment(Utils::QtcProcess *process); signals: - void done(const QString &error); + void done(); private: QString m_remoteCommand; diff --git a/src/libs/ssh/sshremoteprocessrunner.cpp b/src/libs/ssh/sshremoteprocessrunner.cpp index f79e46b40d..73626e6a41 100644 --- a/src/libs/ssh/sshremoteprocessrunner.cpp +++ b/src/libs/ssh/sshremoteprocessrunner.cpp @@ -142,11 +142,11 @@ void SshRemoteProcessRunner::handleProcessStarted() emit processStarted(); } -void SshRemoteProcessRunner::handleProcessFinished(const QString &error) +void SshRemoteProcessRunner::handleProcessFinished() { d->m_exitStatus = d->m_process->exitStatus(); d->m_exitCode = d->m_process->exitCode(); - d->m_processErrorString = error; + d->m_processErrorString = d->m_process->errorString(); setState(Inactive); emit processClosed(d->m_processErrorString); } diff --git a/src/libs/ssh/sshremoteprocessrunner.h b/src/libs/ssh/sshremoteprocessrunner.h index 43e8bda6db..0a1af87e5b 100644 --- a/src/libs/ssh/sshremoteprocessrunner.h +++ b/src/libs/ssh/sshremoteprocessrunner.h @@ -64,7 +64,7 @@ private: void handleConnectionError(); void handleDisconnected(); void handleProcessStarted(); - void handleProcessFinished(const QString &error); + void handleProcessFinished(); void runInternal(const QString &command, const QSsh::SshConnectionParameters &sshParams); void setState(int newState); diff --git a/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp b/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp index b1c5275272..389abe21d4 100644 --- a/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp +++ b/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp @@ -196,8 +196,9 @@ void SshDeviceProcess::handleConnected() } else { connect(d->remoteProcess.get(), &QSsh::SshRemoteProcess::started, this, &SshDeviceProcess::handleProcessStarted); - connect(d->remoteProcess.get(), &QSsh::SshRemoteProcess::done, - this, &SshDeviceProcess::handleProcessFinished); + connect(d->remoteProcess.get(), &QSsh::SshRemoteProcess::done, this, [this] { + handleProcessFinished(d->remoteProcess->errorString()); + }); connect(d->remoteProcess.get(), &QSsh::SshRemoteProcess::readyReadStandardOutput, this, &QtcProcess::readyReadStandardOutput); connect(d->remoteProcess.get(), &QSsh::SshRemoteProcess::readyReadStandardError, diff --git a/src/plugins/remotelinux/genericdirectuploadservice.cpp b/src/plugins/remotelinux/genericdirectuploadservice.cpp index ecbac0498c..0a129b2a60 100644 --- a/src/plugins/remotelinux/genericdirectuploadservice.cpp +++ b/src/plugins/remotelinux/genericdirectuploadservice.cpp @@ -200,12 +200,11 @@ void GenericDirectUploadService::runStat(const DeployableFile &file) const QString statCmd = "stat -t " + Utils::ProcessArgs::quoteArgUnix(file.remoteFilePath()); SshRemoteProcess * const statProc = connection()->createRemoteProcess(statCmd).release(); statProc->setParent(this); - connect(statProc, &SshRemoteProcess::done, this, - [this, statProc, state = d->state](const QString &errorMsg) { + connect(statProc, &SshRemoteProcess::done, this, [this, statProc, state = d->state] { QTC_ASSERT(d->state == state, return); const DeployableFile file = d->getFileForProcess(statProc); QTC_ASSERT(file.isValid(), return); - const QDateTime timestamp = timestampFromStat(file, statProc, errorMsg); + const QDateTime timestamp = timestampFromStat(file, statProc, statProc->errorString()); statProc->deleteLater(); switch (state) { case PreChecking: @@ -342,11 +341,11 @@ void GenericDirectUploadService::chmod() SshRemoteProcess * const chmodProc = connection()->createRemoteProcess(command).release(); chmodProc->setParent(this); - connect(chmodProc, &SshRemoteProcess::done, this, - [this, chmodProc, state = d->state](const QString &error) { + connect(chmodProc, &SshRemoteProcess::done, this, [this, chmodProc, state = d->state] { QTC_ASSERT(state == d->state, return); const DeployableFile file = d->getFileForProcess(chmodProc); QTC_ASSERT(file.isValid(), return); + const QString error = chmodProc->errorString(); if (!error.isEmpty()) { emit warningMessage(tr("Remote chmod failed for file \"%1\": %2") .arg(file.remoteFilePath(), error)); diff --git a/src/plugins/remotelinux/linuxdevicetester.cpp b/src/plugins/remotelinux/linuxdevicetester.cpp index a7e0975bca..9640f2c278 100644 --- a/src/plugins/remotelinux/linuxdevicetester.cpp +++ b/src/plugins/remotelinux/linuxdevicetester.cpp @@ -143,11 +143,11 @@ void GenericLinuxDeviceTester::handleConnectionFailure() setFinished(TestFailure); } -void GenericLinuxDeviceTester::handleProcessFinished(const QString &error) +void GenericLinuxDeviceTester::handleProcessFinished() { QTC_ASSERT(d->state == RunningUname, return); - if (!error.isEmpty() || d->process->exitCode() != 0) { + if (!d->process->errorString().isEmpty() || d->process->exitCode() != 0) { const QByteArray stderrOutput = d->process->readAllStandardError(); if (!stderrOutput.isEmpty()) emit errorMessage(tr("uname failed: %1").arg(QString::fromUtf8(stderrOutput)) + QLatin1Char('\n')); diff --git a/src/plugins/remotelinux/linuxdevicetester.h b/src/plugins/remotelinux/linuxdevicetester.h index 4cc6c7f9af..c573623a90 100644 --- a/src/plugins/remotelinux/linuxdevicetester.h +++ b/src/plugins/remotelinux/linuxdevicetester.h @@ -47,7 +47,7 @@ public: private: void handleConnected(); void handleConnectionFailure(); - void handleProcessFinished(const QString &error); + void handleProcessFinished(); void handlePortsGatheringError(const QString &message); void handlePortListReady(); void handleSftpStarted(); diff --git a/src/plugins/remotelinux/rsyncdeploystep.cpp b/src/plugins/remotelinux/rsyncdeploystep.cpp index 5d5accd20a..7f7842b56a 100644 --- a/src/plugins/remotelinux/rsyncdeploystep.cpp +++ b/src/plugins/remotelinux/rsyncdeploystep.cpp @@ -103,8 +103,9 @@ void RsyncDeployService::createRemoteDirectories() remoteDirs.removeDuplicates(); m_mkdir = connection()->createRemoteProcess("mkdir -p " + ProcessArgs::createUnixArgs(remoteDirs).toString()); - connect(m_mkdir.get(), &SshRemoteProcess::done, this, [this](const QString &error) { + connect(m_mkdir.get(), &SshRemoteProcess::done, this, [this] { QString userError; + const QString error = m_mkdir->errorString(); if (!error.isEmpty()) userError = error; if (m_mkdir->exitCode() != 0) diff --git a/tests/manual/ssh/shell/shell.cpp b/tests/manual/ssh/shell/shell.cpp index a588a17c90..d2faf448ff 100644 --- a/tests/manual/ssh/shell/shell.cpp +++ b/tests/manual/ssh/shell/shell.cpp @@ -95,10 +95,10 @@ void Shell::handleRemoteStderr() std::cerr << m_shell->readAllStandardError().data() << std::flush; } -void Shell::handleChannelClosed(const QString &error) +void Shell::handleChannelClosed() { std::cerr << "Shell closed. Exit code was " << m_shell->exitCode() << "." << std::endl; - QCoreApplication::exit(error.isEmpty() && m_shell->exitCode() == 0 + QCoreApplication::exit(m_shell->errorString().isEmpty() && m_shell->exitCode() == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } diff --git a/tests/manual/ssh/shell/shell.h b/tests/manual/ssh/shell/shell.h index afebee0de4..db8bcce9ca 100644 --- a/tests/manual/ssh/shell/shell.h +++ b/tests/manual/ssh/shell/shell.h @@ -50,7 +50,7 @@ private: void handleRemoteStdout(); void handleRemoteStderr(); void handleShellMessage(const QString &message); - void handleChannelClosed(const QString &error); + void handleChannelClosed(); void handleShellStarted(); void handleStdin(); |