From 583543ebdab4538497e63cf62d26ab96704ba7b9 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 20 May 2015 13:12:33 +0200 Subject: qmlprofiler: In interactive mode, don't quit if application quits We might want to inspect or save the pending data in some special way. Change-Id: I235b1f948ad4a9ddd100332991243231119bcf08 Reviewed-by: Joerg Bornemann --- tools/qmlprofiler/qmlprofilerapplication.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tools') diff --git a/tools/qmlprofiler/qmlprofilerapplication.cpp b/tools/qmlprofiler/qmlprofilerapplication.cpp index eb67b5f40e..c2d3375d10 100644 --- a/tools/qmlprofiler/qmlprofilerapplication.cpp +++ b/tools/qmlprofiler/qmlprofilerapplication.cpp @@ -354,19 +354,19 @@ void QmlProfilerApplication::processHasOutput() void QmlProfilerApplication::processFinished() { Q_ASSERT(m_process); + int exitCode = 0; if (m_process->exitStatus() == QProcess::NormalExit) { logStatus(QString("Process exited (%1).").arg(m_process->exitCode())); - if (m_recording) { - logError("Process exited while recording, last trace is lost!"); - exit(2); - } else { - exit(0); + logError("Process exited while recording, last trace is damaged!"); + exitCode = 2; } } else { - logError("Process crashed! Exiting ..."); - exit(3); + logError("Process crashed!"); + exitCode = 3; } + if (!m_interactive) + exit(exitCode); } void QmlProfilerApplication::traceClientEnabled() -- cgit v1.2.3