Use process launcher implementation for all QtC code base

Use QTC_USE_QPROCESS env var to switch back to the original
implementation based on direct use of QProcess. By default
a new implementation employing process launcher will be used.

Change-Id: I75c3efb579e26de377fc785404f1e2a08367d994
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2021-08-09 16:54:23 +02:00
parent ba5f2e27f0
commit 3143ba79e3

View File

@@ -441,6 +441,13 @@ QtcProcess::Result QtcProcessPrivate::interpretExitCode(int exitCode)
\sa Utils::ProcessArgs
*/
static QtcProcess::ProcessImpl defaultProcessImpl()
{
if (qEnvironmentVariableIsSet("QTC_USE_QPROCESS"))
return QtcProcess::QProcessImpl;
return QtcProcess::ProcessLauncherImpl;
}
QtcProcess::QtcProcess(ProcessImpl processImpl, ProcessMode processMode, QObject *parent)
: QObject(parent), d(new QtcProcessPrivate(this, processImpl, processMode))
{
@@ -451,10 +458,10 @@ QtcProcess::QtcProcess(ProcessImpl processImpl, ProcessMode processMode, QObject
}
QtcProcess::QtcProcess(ProcessMode processMode, QObject *parent)
: QtcProcess(QtcProcess::QProcessImpl, processMode, parent) {}
: QtcProcess(defaultProcessImpl(), processMode, parent) {}
QtcProcess::QtcProcess(QObject *parent)
: QtcProcess(QtcProcess::QProcessImpl, ProcessMode::Reader, parent) {}
: QtcProcess(defaultProcessImpl(), ProcessMode::Reader, parent) {}
QtcProcess::~QtcProcess()
{