ProjectExplorer: Be more transparent about how we stop a process

Forward the information about the two-stage stop procedure to the user.

Change-Id: I5facd44d2fa6a4db3de09936f07f69840344eb03
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2024-08-22 13:47:35 +02:00
parent b7489fb55a
commit 9970ba0a6c
3 changed files with 10 additions and 0 deletions

View File

@@ -784,6 +784,7 @@ public:
m_killTimer.setSingleShot(true);
connect(&m_killTimer, &QTimer::timeout, this, [this] {
m_killTimer.stop();
emit q->stoppingForcefully();
sendControlSignal(ControlSignal::Kill);
});
setupDebugLog();
@@ -1658,6 +1659,7 @@ void Process::stop()
if (state() == QProcess::NotRunning)
return;
emit requestingStop();
d->sendControlSignal(ControlSignal::Terminate);
d->m_killTimer.start(d->m_process->m_setup.m_reaperTimeout);
}

View File

@@ -199,6 +199,8 @@ signals:
void readyReadStandardError();
void textOnStandardOutput(const QString &text);
void textOnStandardError(const QString &text);
void requestingStop();
void stoppingForcefully();
private:
friend QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug str, const Process &r);

View File

@@ -1296,6 +1296,12 @@ SimpleTargetRunnerPrivate::SimpleTargetRunnerPrivate(SimpleTargetRunner *parent)
this, &SimpleTargetRunnerPrivate::handleStandardError);
connect(&m_process, &Process::readyReadStandardOutput,
this, &SimpleTargetRunnerPrivate::handleStandardOutput);
connect(&m_process, &Process::requestingStop, this, [this] {
q->appendMessage(Tr::tr("Requesting process to stop ...."), NormalMessageFormat);
});
connect(&m_process, &Process::stoppingForcefully, this, [this] {
q->appendMessage(Tr::tr("Stopping process forcefully ...."), NormalMessageFormat);
});
m_waitForDoneTimer.setSingleShot(true);
connect(&m_waitForDoneTimer, &QTimer::timeout, this, [this] {