From 232724cc11db671e9e92aa02a8b974f63ca26553 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 14 Nov 2011 17:23:51 +0100 Subject: SSH: Make API of SshRemoteProcess more similar to the one of QProcess. In the end, we want to derive it from QIODevice as well. Change-Id: I30e7cb23ec8e5753c363d1f4457b650556860ac2 Reviewed-by: Christian Kandeler --- src/plugins/valgrind/valgrindprocess.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'src/plugins/valgrind/valgrindprocess.cpp') diff --git a/src/plugins/valgrind/valgrindprocess.cpp b/src/plugins/valgrind/valgrindprocess.cpp index e58c5ee54a..d6264b1f7e 100644 --- a/src/plugins/valgrind/valgrindprocess.cpp +++ b/src/plugins/valgrind/valgrindprocess.cpp @@ -210,10 +210,8 @@ void RemoteValgrindProcess::connected() cmd += m_valgrindExe + ' ' + arguments; m_process = m_connection->createRemoteProcess(cmd.toUtf8()); - connect(m_process.data(), SIGNAL(errorOutputAvailable(QByteArray)), - this, SLOT(standardError(QByteArray))); - connect(m_process.data(), SIGNAL(outputAvailable(QByteArray)), - this, SLOT(standardOutput(QByteArray))); + connect(m_process.data(), SIGNAL(readyReadStandardError()), this, SLOT(standardError())); + connect(m_process.data(), SIGNAL(readyReadStandardOutput()), this, SLOT(standardOutput())); connect(m_process.data(), SIGNAL(closed(int)), this, SLOT(closed(int))); connect(m_process.data(), SIGNAL(started()), @@ -250,17 +248,15 @@ void RemoteValgrindProcess::processStarted() ).arg(proc, QFileInfo(m_debuggee).fileName()); m_findPID = m_connection->createRemoteProcess(cmd.toUtf8()); - connect(m_findPID.data(), SIGNAL(errorOutputAvailable(QByteArray)), - this, SLOT(standardOutput(QByteArray))); - connect(m_findPID.data(), SIGNAL(outputAvailable(QByteArray)), - this, SLOT(findPIDOutputReceived(QByteArray))); + connect(m_findPID.data(), SIGNAL(readyReadStandardError()), this, SLOT(standardError())); + connect(m_findPID.data(), SIGNAL(readyReadStandardOutput()), SLOT(findPIDOutputReceived())); m_findPID->start(); } -void RemoteValgrindProcess::findPIDOutputReceived(const QByteArray &output) +void RemoteValgrindProcess::findPIDOutputReceived() { bool ok; - m_pid = output.trimmed().toLongLong(&ok); + m_pid = m_findPID->readAllStandardOutput().trimmed().toLongLong(&ok); if (!ok) { m_pid = 0; m_errorString = tr("Could not determine remote PID."); @@ -272,14 +268,14 @@ void RemoteValgrindProcess::findPIDOutputReceived(const QByteArray &output) } } -void RemoteValgrindProcess::standardOutput(const QByteArray &output) +void RemoteValgrindProcess::standardOutput() { - emit processOutput(output, Utils::StdOutFormat); + emit processOutput(m_process->readAllStandardOutput(), Utils::StdOutFormat); } -void RemoteValgrindProcess::standardError(const QByteArray &output) +void RemoteValgrindProcess::standardError() { - emit processOutput(output, Utils::StdErrFormat); + emit processOutput(m_process->readAllStandardError(), Utils::StdErrFormat); } void RemoteValgrindProcess::error(Utils::SshError error) -- cgit v1.2.1