Utils: Dissolve QtcProcess::stopProcess

Change-Id: Ife07f34ffc69cd30984276464bd89738c2a71311
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
hjk
2022-06-16 10:56:26 +02:00
parent b7a71af4c1
commit 53896ed295
2 changed files with 2 additions and 13 deletions

View File

@@ -1285,17 +1285,6 @@ void QtcProcess::setRemoteProcessHooks(const DeviceProcessHooks &hooks)
s_deviceHooks = hooks; s_deviceHooks = hooks;
} }
void QtcProcess::stopProcess()
{
if (state() == QProcess::NotRunning)
return;
terminate();
if (waitForFinished(300))
return;
kill();
waitForFinished(300);
}
static bool askToKill(const QString &command) static bool askToKill(const QString &command)
{ {
#ifdef QT_GUI_LIB #ifdef QT_GUI_LIB
@@ -1940,7 +1929,8 @@ void QtcProcessPrivate::slotTimeout()
|| askToKill(m_setup.m_commandLine.executable().toString()); || askToKill(m_setup.m_commandLine.executable().toString());
m_waitingForUser = false; m_waitingForUser = false;
if (terminate) { if (terminate) {
q->stopProcess(); q->stop();
q->waitForFinished();
m_result = ProcessResult::Hang; m_result = ProcessResult::Hang;
} else { } else {
m_hangTimerCount = 0; m_hangTimerCount = 0;

View File

@@ -175,7 +175,6 @@ public:
void setStdErrCallback(const std::function<void(const QString &)> &callback); void setStdErrCallback(const std::function<void(const QString &)> &callback);
void setStdErrLineCallback(const std::function<void(const QString &)> &callback); void setStdErrLineCallback(const std::function<void(const QString &)> &callback);
void stopProcess();
bool readDataFromProcess(int timeoutS, QByteArray *stdOut, QByteArray *stdErr, bool readDataFromProcess(int timeoutS, QByteArray *stdOut, QByteArray *stdErr,
bool showTimeOutMessageBox); bool showTimeOutMessageBox);