Use a new enum indicating various start failures

Before the m_startFailure flag was used to detect the case
when the process failed to start because of wrong filename.
As this flag was set on any possible error we have always
detected the wrong filename case. Replace this flag with a
new enum describing various start failures.

Don't report again the crashed message. Check if we have already
reported the stop and we don't report it again. The
processExited() handler is being called twice: directly from
localGuiProcessError() and through the delayed localProcessDone().

Fixes: QTCREATORBUG-26467
Change-Id: I3cc6aa0c0b702256cefd77ba95793cd31e82ae10
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2021-10-26 11:10:06 +02:00
parent de2423f514
commit 0556eec9b7
2 changed files with 22 additions and 19 deletions

View File

@@ -1219,17 +1219,14 @@ void SimpleTargetRunner::doStart(const Runnable &runnable, const IDevice::ConstP
connect(&m_launcher, &ApplicationLauncher::processExited,
this, [this, runnable](int exitCode, QProcess::ExitStatus status) {
QString msg;
if (status == QProcess::CrashExit)
msg = tr("%1 crashed.");
else
msg = tr("%2 exited with code %1").arg(exitCode);
if (m_stopReported)
return;
const QString msg = (status == QProcess::CrashExit)
? tr("%1 crashed.") : tr("%2 exited with code %1").arg(exitCode);
const QString displayName = runnable.command.executable().toUserOutput();
appendMessage(msg.arg(displayName), Utils::NormalMessageFormat);
if (!m_stopReported) {
m_stopReported = true;
reportStopped();
}
m_stopReported = true;
reportStopped();
});
connect(&m_launcher, &ApplicationLauncher::error,