summaryrefslogtreecommitdiff
path: root/libre/qtcreator/qtcreatorbug-19367b.patch
blob: 7603877cd678d8722f1f4280bd988b646372d40b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 813c16854df6be7fd1f1a8013d0b180f6248e5ab Mon Sep 17 00:00:00 2001
From: Jonathan Liu <net147@gmail.com>
Date: Thu, 20 Sep 2018 13:48:58 +1000
Subject: SshDeviceProcess: Don't emit readyRead signals if no data available

Task-number: QTCREATORBUG-19367
Change-Id: I477800b2e2060748c2b5f9fde3acc91d9f5ae176
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
---
 src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp b/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp
index b34e0ce805..3bb813d55d 100644
--- a/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp
+++ b/src/plugins/projectexplorer/devicesupport/sshdeviceprocess.cpp
@@ -245,13 +245,19 @@ void SshDeviceProcess::handleProcessFinished(int exitStatus)
 
 void SshDeviceProcess::handleStdout()
 {
-    d->stdOut += d->process->readAllStandardOutput();
+    QByteArray output = d->process->readAllStandardOutput();
+    if (output.isEmpty())
+        return;
+    d->stdOut += output;
     emit readyReadStandardOutput();
 }
 
 void SshDeviceProcess::handleStderr()
 {
-    d->stdErr += d->process->readAllStandardError();
+    QByteArray output = d->process->readAllStandardError();
+    if (output.isEmpty())
+        return;
+    d->stdErr += output;
     emit readyReadStandardError();
 }
 
-- 
cgit v1.2.1