SSH: Fix connection check in SFTPFileSystemModel.

The current code is not technically buggy, but does unnecessary
things and therefore might confuse people looking at it.

Change-Id: Ia6fcca575a8cc9856e86c66f337e2bffd9bf4b3a
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
Christian Kandeler
2012-04-03 10:06:44 +02:00
parent 078d570721
commit 27730b8455

View File

@@ -120,8 +120,10 @@ void SftpFileSystemModel::setSshConnection(const SshConnectionParameters &sshPar
d->sshConnection = SshConnectionManager::instance().acquireConnection(sshParams); d->sshConnection = SshConnectionManager::instance().acquireConnection(sshParams);
connect(d->sshConnection.data(), SIGNAL(error(Utils::SshError)), connect(d->sshConnection.data(), SIGNAL(error(Utils::SshError)),
SLOT(handleSshConnectionFailure())); SLOT(handleSshConnectionFailure()));
if (d->sshConnection->state() == SshConnection::Connected) if (d->sshConnection->state() == SshConnection::Connected) {
handleSshConnectionEstablished(); handleSshConnectionEstablished();
return;
}
connect(d->sshConnection.data(), SIGNAL(connected()), SLOT(handleSshConnectionEstablished())); connect(d->sshConnection.data(), SIGNAL(connected()), SLOT(handleSshConnectionEstablished()));
if (d->sshConnection->state() == SshConnection::Unconnected) if (d->sshConnection->state() == SshConnection::Unconnected)
d->sshConnection->connectToHost(); d->sshConnection->connectToHost();