From 7b08a8131614d9b1d37a8ee968ad740d5cf9bc6d Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 2 Sep 2024 14:19:47 +0200 Subject: [PATCH] ProjectExplorer: Always print process exit code on normal exit ... in SimpleTargetRunner. Fixes: QTCREATORBUG-31141 Change-Id: Iede5d88c11312152f771d3008bb1cd6d471cfaf3 Reviewed-by: hjk --- src/plugins/projectexplorer/runcontrol.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index b7300b1ef3e..a5652f41f82 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -1477,12 +1477,14 @@ void SimpleTargetRunnerPrivate::forwardDone() m_waitForDoneTimer.stop(); const QString executable = m_command.executable().displayName(); QString msg = Tr::tr("%1 exited with code %2").arg(executable).arg(m_resultData.m_exitCode); - if (m_resultData.m_exitStatus == QProcess::CrashExit) - msg = Tr::tr("%1 crashed.").arg(executable); - else if (m_stopForced) - msg = Tr::tr("The process was ended forcefully."); - else if (m_resultData.m_error != QProcess::UnknownError) + if (m_resultData.m_exitStatus == QProcess::CrashExit) { + if (m_stopForced) + msg = Tr::tr("The process was ended forcefully."); + else + msg = Tr::tr("The process crashed."); + } else if (m_resultData.m_error != QProcess::UnknownError) { msg = RunWorker::userMessageForProcessError(m_resultData.m_error, m_command.executable()); + } q->appendMessage(msg, NormalMessageFormat); m_stopReported = true; q->reportStopped();