From ee42dcb66c508533fbacca1e8f926c73def80ffb Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Tue, 22 Sep 2015 11:56:30 +0200 Subject: [PATCH] Journald: Do not emit signals for kernel messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Those have no _PID set, which we treated as 0. This is also the PID we set when an application is finished. This leads to journald messages showing up in the application output *after* the application was finished. Change-Id: I980199740a85c4e68221399eceb543affa12387f Reviewed-by: Daniel Teske Reviewed-by: Alexander Görtz --- src/plugins/projectexplorer/journaldwatcher.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/journaldwatcher.cpp b/src/plugins/projectexplorer/journaldwatcher.cpp index 1ea4587addc..33aef0e19d4 100644 --- a/src/plugins/projectexplorer/journaldwatcher.cpp +++ b/src/plugins/projectexplorer/journaldwatcher.cpp @@ -227,7 +227,10 @@ void JournaldWatcher::handleEntry() continue; const QByteArray pid = logEntry.value(QByteArrayLiteral("_PID")); - quint64 pidNum = pid.isEmpty() ? 0 : QString::fromLatin1(pid).toInt(); + if (pid.isEmpty()) + continue; + + quint64 pidNum = QString::fromLatin1(pid).toInt(); QString message = QString::fromUtf8(logEntry.value(QByteArrayLiteral("MESSAGE"))); message.append(QLatin1Char('\n')); // Add newline.