Utils: Add a synchronous property to QtcProcess interface

Use it to avoid IDevice interface clutter.

Change-Id: I4a04f04e2c343593d937a402060e56ef94fcabf1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-04-29 15:57:56 +02:00
parent ba36cbfdaa
commit fe8fbf1a4a
6 changed files with 28 additions and 29 deletions

View File

@@ -763,6 +763,9 @@ void QtcProcess::start()
}
QProcess::start(command, arguments.toUnixArgs());
}
if (m_synchronous)
QProcess::waitForFinished();
}
#ifdef Q_OS_WIN
@@ -1262,6 +1265,16 @@ void QtcProcess::setupChildProcess_impl()
#endif
}
bool QtcProcess::isSynchronous() const
{
return m_synchronous;
}
void QtcProcess::setSynchronous(bool on)
{
m_synchronous = on;
}
bool QtcProcess::ArgIterator::next()
{
// We delay the setting of m_prev so we can still delete the last argument