From 01d6d5eac37cf4bdc1f14b79ccdaddc566b2193a Mon Sep 17 00:00:00 2001
From: Mehdi Fekari <mfekari@rim.com>
Date: Thu, 20 Dec 2012 09:24:56 -0500
Subject: [PATCH] Qnx: Display output logs when restarting the application
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Call immediately tailApplication() if m_slog2infoFound is true.

Change-Id: I9233a1f9e6f4843ab9af8b40c18e8766c8431677
Reviewed-by: Tobias Nätterlund <tobias.naetterlund@kdab.com>
Reviewed-by: Wolfgang Bremer <wbremer@rim.com>
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
---
 src/plugins/qnx/blackberryapplicationrunner.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/plugins/qnx/blackberryapplicationrunner.cpp b/src/plugins/qnx/blackberryapplicationrunner.cpp
index d69092eb0c2..7ea100e6ab1 100644
--- a/src/plugins/qnx/blackberryapplicationrunner.cpp
+++ b/src/plugins/qnx/blackberryapplicationrunner.cpp
@@ -84,7 +84,7 @@ using namespace Qnx::Internal;
 BlackBerryApplicationRunner::BlackBerryApplicationRunner(bool debugMode, BlackBerryRunConfiguration *runConfiguration, QObject *parent)
     : QObject(parent)
     , m_debugMode(debugMode)
-    , m_slog2infoFound(true)
+    , m_slog2infoFound(false)
     , m_pid(-1)
     , m_appId(QString())
     , m_running(false)
@@ -146,8 +146,9 @@ void BlackBerryApplicationRunner::start()
 
 void BlackBerryApplicationRunner::checkSlog2Info()
 {
-    // Not necessary to retest if slog2info exists.
-    if (!m_testSlog2Process) {
+    if (m_slog2infoFound) {
+        tailApplicationLog();
+    } else if (!m_testSlog2Process) {
         m_testSlog2Process = new QSsh::SshRemoteProcessRunner(this);
         connect(m_testSlog2Process, SIGNAL(processClosed(int)),
                 this, SLOT(handleSlog2InfoFound()));
-- 
GitLab