forked from qt-creator/qt-creator
QtcSsh: Connect to QtcProcess::done() signal
Instead of connecting to errorOccurred() and finished() signals. Change-Id: I113f51564501a67725afee77ab4d20e5d954a7c0 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -186,21 +186,12 @@ SshConnection::SshConnection(const SshConnectionParameters &serverInfo, QObject
|
||||
if (reply == "\n")
|
||||
emitConnected();
|
||||
});
|
||||
connect(&d->masterProcess, &QtcProcess::errorOccurred, [this] (QProcess::ProcessError error) {
|
||||
switch (error) {
|
||||
case QProcess::FailedToStart:
|
||||
connect(&d->masterProcess, &QtcProcess::done, this, [this] {
|
||||
if (d->masterProcess.error() == QProcess::FailedToStart) {
|
||||
emitError(tr("Cannot establish SSH connection: Control process failed to start: %1")
|
||||
.arg(d->fullProcessError()));
|
||||
break;
|
||||
case QProcess::Crashed: // Handled by finished() handler.
|
||||
case QProcess::Timedout:
|
||||
case QProcess::ReadError:
|
||||
case QProcess::WriteError:
|
||||
case QProcess::UnknownError:
|
||||
break; // Cannot happen.
|
||||
return;
|
||||
}
|
||||
});
|
||||
connect(&d->masterProcess, &QtcProcess::finished, [this] {
|
||||
if (d->state == Disconnecting) {
|
||||
emitDisconnected();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user