aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/ssh
diff options
context:
space:
mode:
authorJarek Kobus <[email protected]>2022-04-04 13:17:36 +0200
committerJarek Kobus <[email protected]>2022-04-04 13:28:12 +0000
commitab11c4373b53953915cb6886356172a991660b8f (patch)
treeae0554f29e103a7523f7f46ea63da5bb6c1d6a11 /src/libs/ssh
parentd950eb498fc1f0ef77e82180a4e009eb56ba8ccd (diff)
QtcProcess: Introduce done() signal
Introduce QtcProcess::done() signal. It's similar to QtcProcess::finished() signal, but also emitted when process failed to start (so after QProcess::FailedToStart error occurred). SshRemoteProcess::finished() signal was already behaving like this. So, we remove special handling of FailedToStart error in this class and connect all clients of SshRemoteProcess to done() signal, instead of finished(). Task-number: QTCREATORBUG-27232 Change-Id: If4240e2172f3f706e812bca669a1d5b24bdc3285 Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/libs/ssh')
-rw-r--r--src/libs/ssh/sshremoteprocess.cpp9
-rw-r--r--src/libs/ssh/sshremoteprocess.h1
-rw-r--r--src/libs/ssh/sshremoteprocessrunner.cpp10
3 files changed, 7 insertions, 13 deletions
diff --git a/src/libs/ssh/sshremoteprocess.cpp b/src/libs/ssh/sshremoteprocess.cpp
index 088c8f868bd..97ca54dcc85 100644
--- a/src/libs/ssh/sshremoteprocess.cpp
+++ b/src/libs/ssh/sshremoteprocess.cpp
@@ -62,14 +62,7 @@ void SshRemoteProcess::emitFinished()
{
if (exitStatus() == QProcess::CrashExit)
m_errorString = tr("The ssh process crashed: %1").arg(errorString());
- emit finished();
-}
-
-void SshRemoteProcess::emitErrorOccurred(QProcess::ProcessError error)
-{
- if (error == QProcess::FailedToStart)
- emit finished();
- emit errorOccurred(error);
+ QtcProcess::emitFinished();
}
void SshRemoteProcess::start()
diff --git a/src/libs/ssh/sshremoteprocess.h b/src/libs/ssh/sshremoteprocess.h
index 99aa01a1cec..8f80ac1a5a4 100644
--- a/src/libs/ssh/sshremoteprocess.h
+++ b/src/libs/ssh/sshremoteprocess.h
@@ -50,7 +50,6 @@ public:
protected:
void emitFinished() override;
- void emitErrorOccurred(QProcess::ProcessError error) override;
private:
QString m_remoteCommand;
diff --git a/src/libs/ssh/sshremoteprocessrunner.cpp b/src/libs/ssh/sshremoteprocessrunner.cpp
index c1259f4d9e1..617ffc000c4 100644
--- a/src/libs/ssh/sshremoteprocessrunner.cpp
+++ b/src/libs/ssh/sshremoteprocessrunner.cpp
@@ -36,6 +36,8 @@
running a remote process over an SSH connection.
*/
+using namespace Utils;
+
namespace QSsh {
namespace Internal {
namespace {
@@ -109,13 +111,13 @@ void SshRemoteProcessRunner::handleConnected()
setState(Connected);
d->m_process = d->m_connection->createRemoteProcess(d->m_command);
- connect(d->m_process.get(), &SshRemoteProcess::started,
+ connect(d->m_process.get(), &QtcProcess::started,
this, &SshRemoteProcessRunner::handleProcessStarted);
- connect(d->m_process.get(), &SshRemoteProcess::finished,
+ connect(d->m_process.get(), &QtcProcess::done,
this, &SshRemoteProcessRunner::handleProcessFinished);
- connect(d->m_process.get(), &SshRemoteProcess::readyReadStandardOutput,
+ connect(d->m_process.get(), &QtcProcess::readyReadStandardOutput,
this, &SshRemoteProcessRunner::readyReadStandardOutput);
- connect(d->m_process.get(), &SshRemoteProcess::readyReadStandardError,
+ connect(d->m_process.get(), &QtcProcess::readyReadStandardError,
this, &SshRemoteProcessRunner::readyReadStandardError);
d->m_process->start();
}