ProjectExplorer: Fix shutting down unreachable remote processes

We forgot to reset the state, which gave us a permanently broken run
control, preventing re-starting the application, among other things.

Change-Id: I7c168e31e015fdf7002c57aba0ed2178437a15ae
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Christian Kandeler
2023-12-11 13:47:57 +01:00
parent a374588604
commit f8cdcfd70c

View File

@@ -1305,16 +1305,18 @@ void SimpleTargetRunnerPrivate::stop()
m_stopRequested = true;
q->appendMessage(Tr::tr("User requested stop. Shutting down..."), NormalMessageFormat);
switch (m_state) {
case Run:
m_process.stop();
if (!m_process.waitForFinished(2000)) { // TODO: it may freeze on some devices
QTC_CHECK(false); // Shouldn't happen, just emergency handling
m_process.close();
forwardDone();
}
break;
case Inactive:
break;
case Run:
m_process.stop();
if (!m_process.waitForFinished(2000)) { // TODO: it may freeze on some devices
q->appendMessage(Tr::tr("Remote process did not finish in time. "
"Connectivity lost?"), ErrorMessageFormat);
m_process.close();
m_state = Inactive;
forwardDone();
}
break;
case Inactive:
break;
}
}
}