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