forked from qt-creator/qt-creator
Utils: fix QProcess backend on Windows
Do not return false from QtcProces::waitForStarted if the process is already running. This causes mayor issues on windows since QProcess directly emits started and therefore switches to the running state after calling QProcess::start. Change-Id: I4604b08a59918d3df11c8a174b57e1e483e78a0d Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -1166,7 +1166,9 @@ qint64 QtcProcess::processId() const
|
||||
bool QtcProcess::waitForStarted(int msecs)
|
||||
{
|
||||
QTC_ASSERT(d->m_process, return false);
|
||||
if (d->m_state != QProcess::Starting)
|
||||
if (d->m_state == QProcess::Running)
|
||||
return true;
|
||||
if (d->m_state == QProcess::NotRunning)
|
||||
return false;
|
||||
return s_waitForStarted.measureAndRun(&ProcessInterface::waitForStarted, d->m_process, msecs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user