diff options
author | Ola Røer Thorsen <ola@silentwings.no> | 2019-01-02 15:24:01 +0100 |
---|---|---|
committer | Ola Røer Thorsen <ola@silentwings.no> | 2019-01-03 13:22:42 +0000 |
commit | a25b4897469a6c1e38eba22f7c615e247efe02d9 (patch) | |
tree | 64b112c06237d2a92f9b12319949a8933e423a86 /src | |
parent | 83c43258e0a8f7e45808ecdf60b49938413c85bf (diff) |
Add atEnd() function to the Process service
This makes it possible to use readLine in a while loop until the
complete stream is read, even when reading empty lines.
[ChangeLog] Added atEnd() function to the Process service,
to make it possible to use readLine() in a while loop until
the complete stream is read.
Change-Id: Ie5f047651977195d6a93c4575bd7a8796b83ab5d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/corelib/jsextensions/process.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/corelib/jsextensions/process.cpp b/src/lib/corelib/jsextensions/process.cpp index 1c714fe64..d1bb8bafc 100644 --- a/src/lib/corelib/jsextensions/process.cpp +++ b/src/lib/corelib/jsextensions/process.cpp @@ -81,6 +81,7 @@ public: Q_INVOKABLE void kill(); Q_INVOKABLE QString readLine(); + Q_INVOKABLE bool atEnd() const; Q_INVOKABLE QString readStdOut(); Q_INVOKABLE QString readStdErr(); @@ -269,6 +270,11 @@ QString Process::readLine() return m_textStream->readLine(); } +bool Process::atEnd() const +{ + return m_textStream->atEnd(); +} + QString Process::readStdOut() { return m_textStream->readAll(); |