Port to new connect api

Change-Id: I84834f37dd15108ed8c5fbf5353bcabc4e564f70
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
Montel Laurent
2015-02-04 10:11:46 +01:00
committed by hjk
parent 380acb5baa
commit 6a4d6efb3b
11 changed files with 81 additions and 69 deletions

View File

@@ -113,13 +113,14 @@ void SshRemoteProcessRunner::runInternal(const QByteArray &command,
d->m_exitCode = -1;
d->m_command = command;
d->m_connection = QSsh::acquireConnection(sshParams);
connect(d->m_connection, SIGNAL(error(QSsh::SshError)),
SLOT(handleConnectionError(QSsh::SshError)));
connect(d->m_connection, SIGNAL(disconnected()), SLOT(handleDisconnected()));
connect(d->m_connection, &SshConnection::error,
this, &SshRemoteProcessRunner::handleConnectionError);
connect(d->m_connection, &SshConnection::disconnected,
this, &SshRemoteProcessRunner::handleDisconnected);
if (d->m_connection->state() == SshConnection::Connected) {
handleConnected();
} else {
connect(d->m_connection, SIGNAL(connected()), SLOT(handleConnected()));
connect(d->m_connection, &SshConnection::connected, this, &SshRemoteProcessRunner::handleConnected);
if (d->m_connection->state() == SshConnection::Unconnected)
d->m_connection->connectToHost();
}