forked from qt-creator/qt-creator
QtcProcess: Get rid of setProcessUserEventWhileRunning()
Introduce EventLoopMode enum and pass it to the QtcProcess::runBlocking() instead. There is no need to store this setting. By default this value is NoEventLoop. Change-Id: Icad98b77bec5280b79039b7e5aa4ec408261521c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -705,7 +705,6 @@ public:
|
||||
StartFailure m_startFailure = NoFailure;
|
||||
bool m_timeOutMessageBoxEnabled = false;
|
||||
bool m_waitingForUser = false;
|
||||
bool m_processUserEvents = false;
|
||||
};
|
||||
|
||||
void QtcProcessPrivate::clearForRun()
|
||||
@@ -1445,11 +1444,6 @@ void ChannelBuffer::handleRest()
|
||||
}
|
||||
}
|
||||
|
||||
void QtcProcess::setProcessUserEventWhileRunning()
|
||||
{
|
||||
d->m_processUserEvents = true;
|
||||
}
|
||||
|
||||
void QtcProcess::setTimeoutS(int timeoutS)
|
||||
{
|
||||
if (timeoutS > 0)
|
||||
@@ -1486,7 +1480,7 @@ static bool isGuiThread()
|
||||
}
|
||||
#endif
|
||||
|
||||
void QtcProcess::runBlocking()
|
||||
void QtcProcess::runBlocking(QtcProcess::EventLoopMode eventLoopMode)
|
||||
{
|
||||
// FIXME: Implement properly
|
||||
|
||||
@@ -1497,10 +1491,10 @@ void QtcProcess::runBlocking()
|
||||
};
|
||||
|
||||
qCDebug(processLog).noquote() << "Starting blocking:" << d->m_commandLine.toUserOutput()
|
||||
<< " process user events: " << d->m_processUserEvents;
|
||||
<< " process user events: " << (eventLoopMode == QtcProcess::WithEventLoop);
|
||||
ExecuteOnDestruction logResult([this] { qCDebug(processLog) << *this; });
|
||||
|
||||
if (d->m_processUserEvents) {
|
||||
if (eventLoopMode == QtcProcess::WithEventLoop) {
|
||||
QtcProcess::start();
|
||||
|
||||
// On Windows, start failure is triggered immediately if the
|
||||
|
||||
Reference in New Issue
Block a user