Process: Read QTC_USE_QPROCESS just once

And store it in static variable.

Change-Id: I983ba4d23563ab412ba8db5e4ea4cc1b7a75dba7
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2024-01-22 10:12:54 +01:00
parent 60eaa2c826
commit 2fe5b61aab

View File

@@ -644,7 +644,7 @@ private:
ProcessLauncherBlockingImpl *m_blockingImpl = nullptr;
};
static ProcessImpl defaultProcessImpl()
static ProcessImpl defaultProcessImplHelper()
{
const QString value = qtcEnvironmentVariable("QTC_USE_QPROCESS", "TRUE").toUpper();
if (value != "FALSE" && value != "0")
@@ -652,6 +652,12 @@ static ProcessImpl defaultProcessImpl()
return ProcessImpl::ProcessLauncher;
}
static ProcessImpl defaultProcessImpl()
{
static const ProcessImpl impl = defaultProcessImplHelper();
return impl;
}
class ProcessInterfaceSignal
{
public: