void SshRemoteProcessRunner::handleConnected()
{
    QSSH_ASSERT_AND_RETURN(d->m_state == Connecting);
    setState(Connected);

    d->m_process = d->m_connection->createRemoteProcess(d->m_command);
    connect(d->m_process.data(), SIGNAL(started()), SLOT(handleProcessStarted()));
    connect(d->m_process.data(), SIGNAL(closed(int)), SLOT(handleProcessFinished(int)));
    connect(d->m_process.data(), SIGNAL(readyReadStandardOutput()), SLOT(handleStdout()));
    connect(d->m_process.data(), SIGNAL(readyReadStandardError()), SLOT(handleStderr()));
    if (d->m_runInTerminal)
        d->m_process->requestTerminal(d->m_terminal);
    d->m_process->start();
}
Exemplo n.º 2
0
        connect(d->m_connection.data(), SIGNAL(connected()), SLOT(handleConnected()));
        if (d->m_connection->state() == SshConnection::Unconnected)
            d->m_connection->connectToHost();
    }
}

void SshRemoteProcessRunner::handleConnected()
{
    QTC_ASSERT(d->m_state == Connecting, return);
    setState(Connected);

    d->m_process = d->m_connection->createRemoteProcess(d->m_command);
    connect(d->m_process.data(), SIGNAL(started()), SLOT(handleProcessStarted()));
    connect(d->m_process.data(), SIGNAL(closed(int)), SLOT(handleProcessFinished(int)));
    connect(d->m_process.data(), SIGNAL(readyReadStandardOutput()), SLOT(handleStdout()));
    connect(d->m_process.data(), SIGNAL(readyReadStandardError()), SLOT(handleStderr()));
    if (d->m_runInTerminal)
        d->m_process->requestTerminal(d->m_terminal);
    d->m_process->start();
}

void SshRemoteProcessRunner::handleConnectionError(Utils::SshError error)
{
    d->m_lastConnectionError = error;
    d->m_lastConnectionErrorString = d->m_connection->errorString();
    handleDisconnected();
    emit connectionError();
}

void SshRemoteProcessRunner::handleDisconnected()
{