From 27730b845517fe0cbb95010c38fb834c18b9ad79 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 3 Apr 2012 10:06:44 +0200 Subject: [PATCH] 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 --- src/libs/utils/ssh/sftpfilesystemmodel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/ssh/sftpfilesystemmodel.cpp b/src/libs/utils/ssh/sftpfilesystemmodel.cpp index a6bfa498e6c..d077c698cb7 100644 --- a/src/libs/utils/ssh/sftpfilesystemmodel.cpp +++ b/src/libs/utils/ssh/sftpfilesystemmodel.cpp @@ -120,8 +120,10 @@ void SftpFileSystemModel::setSshConnection(const SshConnectionParameters &sshPar d->sshConnection = SshConnectionManager::instance().acquireConnection(sshParams); connect(d->sshConnection.data(), SIGNAL(error(Utils::SshError)), SLOT(handleSshConnectionFailure())); - if (d->sshConnection->state() == SshConnection::Connected) + if (d->sshConnection->state() == SshConnection::Connected) { handleSshConnectionEstablished(); + return; + } connect(d->sshConnection.data(), SIGNAL(connected()), SLOT(handleSshConnectionEstablished())); if (d->sshConnection->state() == SshConnection::Unconnected) d->sshConnection->connectToHost();