summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2021-08-16 13:43:40 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2021-08-16 12:26:14 +0000
commitc045eb0cf9f6ade82b3249e641291696063e82f8 (patch)
treec284a8cf7c183bbf117453cc9bf4c6e393461ad6
parent51452d08584dc81501b58be6559cc89bc1875c1d (diff)
downloadqt-creator-c045eb0cf9f6ade82b3249e641291696063e82f8.tar.gz
ProjectExplorer: Prevent redundant output on process crash
... in run controls. Fixes: QTCREATORBUG-26049 Change-Id: I51e560fb4674e2b8ac59cb1901d269d8179213d7 Reviewed-by: hjk <hjk@qt.io>
-rw-r--r--src/plugins/projectexplorer/applicationlauncher.cpp4
-rw-r--r--src/plugins/projectexplorer/runcontrol.cpp7
2 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/projectexplorer/applicationlauncher.cpp b/src/plugins/projectexplorer/applicationlauncher.cpp
index 726546636c..16c2bb3eee 100644
--- a/src/plugins/projectexplorer/applicationlauncher.cpp
+++ b/src/plugins/projectexplorer/applicationlauncher.cpp
@@ -286,13 +286,13 @@ void ApplicationLauncherPrivate::localGuiProcessError()
error = ApplicationLauncher::tr("Failed to start program. Path or permissions wrong?");
break;
case QProcess::Crashed:
- error = ApplicationLauncher::tr("The program has unexpectedly finished.");
status = QProcess::CrashExit;
break;
default:
error = ApplicationLauncher::tr("Some error has occurred while running the program.");
}
- emit q->appendMessage(error, ErrorMessageFormat);
+ if (!error.isEmpty())
+ emit q->appendMessage(error, ErrorMessageFormat);
if (m_processRunning && !isRunning()) {
m_processRunning = false;
emit q->processExited(-1, status);
diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp
index 704307c68a..4cd0665f09 100644
--- a/src/plugins/projectexplorer/runcontrol.cpp
+++ b/src/plugins/projectexplorer/runcontrol.cpp
@@ -1233,8 +1233,11 @@ void SimpleTargetRunner::doStart(const Runnable &runnable, const IDevice::ConstP
this, [this, runnable](QProcess::ProcessError error) {
if (error == QProcess::Timedout)
return; // No actual change on the process side.
- const QString msg = userMessageForProcessError(error, runnable.command.executable());
- appendMessage(msg, Utils::NormalMessageFormat);
+ if (error != QProcess::Crashed) {
+ const QString msg = userMessageForProcessError(
+ error, runnable.command.executable());
+ appendMessage(msg, Utils::NormalMessageFormat);
+ }
if (!m_stopReported) {
m_stopReported = true;
reportStopped();