SSH: Make interface more Qt-ish.

This commit is contained in:
ck
2010-05-10 11:01:56 +02:00
parent 642116e4d2
commit f678fce3a6
6 changed files with 54 additions and 26 deletions

View File

@@ -102,8 +102,8 @@ MaemoSshRunner::MaemoSshRunner(const Core::SshServerInfo &server,
bool MaemoSshRunner::runInternal()
{
createConnection();
connect(m_connection.data(), SIGNAL(remoteOutput(QByteArray)),
this, SLOT(handleRemoteOutput(QByteArray)));
connect(m_connection.data(), SIGNAL(remoteOutputAvailable()),
this, SLOT(handleRemoteOutput()));
m_endMarkerCount = 0;
m_promptEncountered = false;
if (!m_connection->start())
@@ -115,8 +115,10 @@ bool MaemoSshRunner::runInternal()
return !m_connection->hasError();
}
void MaemoSshRunner::handleRemoteOutput(const QByteArray &output)
void MaemoSshRunner::handleRemoteOutput()
{
const QByteArray output = m_connection->waitForRemoteOutput(0);
// Wait for a prompt before sending the command.
if (!m_promptEncountered) {
if (output.indexOf(m_prompt) != -1) {

View File

@@ -96,7 +96,7 @@ signals:
private:
virtual bool runInternal();
Q_SLOT void handleRemoteOutput(const QByteArray &output);
Q_SLOT void handleRemoteOutput();
static const QByteArray EndMarker;