Also fix callers potentially violating this policy.
Change-Id: I630f1c544885df93a81e217e792363c0c2314108
Reviewed-on: http://codereview.qt.nokia.com/1186
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
void SshConnectionPrivate::connectToHost()
{
+ QTC_ASSERT(m_state == SocketUnconnected, return);
+
m_incomingData.clear();
m_incomingPacket.reset();
m_sendFacility.reset();
} else {
connect(m_connection.data(), SIGNAL(connected()),
SLOT(handleConnected()));
- m_connection->connectToHost();
+ if (m_connection->state() == SshConnection::Unconnected)
+ m_connection->connectToHost();
}
}
handleConnected();
} else {
connect(m_conn.data(), SIGNAL(connected()), this, SLOT(handleConnected()));
- m_conn->connectToHost();
+ if (m_conn->state() == SshConnection::Unconnected)
+ m_conn->connectToHost();
}
}
connect(m_connection.data(), SIGNAL(connected()), this,
SLOT(handleConnected()));
writeOutput(tr("Connecting to device..."));
- m_connection->connectToHost();
+ if (m_connection->state() == SshConnection::Unconnected)
+ m_connection->connectToHost();
}
}
handleConnected();
} else {
emit reportProgress(tr("Connecting to device..."));
- m_connection->connectToHost();
+ if (m_connection->state() == Utils::SshConnection::Unconnected)
+ m_connection->connectToHost();
}
}
this, SLOT(connected()));
connect(m_connection.data(), SIGNAL(error(Utils::SshError)),
this, SLOT(error(Utils::SshError)));
- m_connection->connectToHost();
+ if (m_connection->state() == Utils::SshConnection::Unconnected)
+ m_connection->connectToHost();
} else {
connected();
}