diff options
author | Christian Kandeler <christian.kandeler@nokia.com> | 2012-06-08 09:42:32 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2012-06-08 10:15:43 +0200 |
commit | 79de09f2663f818bb07c24752e6520b19b28e6ec (patch) | |
tree | 4ee8e676e73646f42476f4f01df3756997836f48 /src/plugins/debugger/lldb | |
parent | 303e67304e42cc419b735ca609104ad4ed386d54 (diff) | |
download | qt-creator-79de09f2663f818bb07c24752e6520b19b28e6ec.tar.gz |
SSH: Streamline SshRemoteProcessRunner's output handling.
Make it just like SshRemoteProcess (and QProcess). The current
implementation annoyingly forces client code to establish additional
signal/slot connections, even if they only want to evaluate the output
at the end.
Change-Id: Id8c30dd156574d7d26d848d8e0705856a16d3747
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/plugins/debugger/lldb')
-rw-r--r-- | src/plugins/debugger/lldb/lldbenginehost.cpp | 14 | ||||
-rw-r--r-- | src/plugins/debugger/lldb/lldbenginehost.h | 4 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/plugins/debugger/lldb/lldbenginehost.cpp b/src/plugins/debugger/lldb/lldbenginehost.cpp index 9e36567ee8..ea0b249c03 100644 --- a/src/plugins/debugger/lldb/lldbenginehost.cpp +++ b/src/plugins/debugger/lldb/lldbenginehost.cpp @@ -70,10 +70,8 @@ SshIODevice::SshIODevice(QSsh::SshRemoteProcessRunner *r) { setOpenMode(QIODevice::ReadWrite | QIODevice::Unbuffered); connect (runner, SIGNAL(processStarted()), this, SLOT(processStarted())); - connect(runner, SIGNAL(processOutputAvailable(QByteArray)), - this, SLOT(outputAvailable(QByteArray))); - connect(runner, SIGNAL(processErrorOutputAvailable(QByteArray)), - this, SLOT(errorOutputAvailable(QByteArray))); + connect(runner, SIGNAL(readyReadStandardOutput()), this, SLOT(outputAvailable())); + connect(runner, SIGNAL(readyReadStandardError()), this, SLOT(errorOutputAvailable())); } SshIODevice::~SshIODevice() @@ -130,15 +128,15 @@ void SshIODevice::processStarted() runner->writeDataToProcess(startupbuffer); } -void SshIODevice::outputAvailable(const QByteArray &output) +void SshIODevice::outputAvailable() { - buckets.enqueue(output); + buckets.enqueue(runner->readAllStandardOutput()); emit readyRead(); } -void SshIODevice::errorOutputAvailable(const QByteArray &output) +void SshIODevice::errorOutputAvailable() { - fprintf(stderr, "%s", output.data()); + fprintf(stderr, "%s", runner->readAllStandardError().data()); } diff --git a/src/plugins/debugger/lldb/lldbenginehost.h b/src/plugins/debugger/lldb/lldbenginehost.h index 5b301b3962..9abc9e31cb 100644 --- a/src/plugins/debugger/lldb/lldbenginehost.h +++ b/src/plugins/debugger/lldb/lldbenginehost.h @@ -56,8 +56,8 @@ public: virtual qint64 readData (char * data, qint64 maxSize); private slots: void processStarted(); - void outputAvailable(const QByteArray &output); - void errorOutputAvailable(const QByteArray &output); + void outputAvailable(); + void errorOutputAvailable(); private: QSsh::SshRemoteProcessRunner *runner; QSsh::SshRemoteProcess::Ptr proc; |