forked from qt-creator/qt-creator
Utils: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*
And instead of qgetenv. Takes Qt Creator's setting at "Environment > System > Environment" into account, which makes it easier on some platforms to set them (e.g. macOS), can be configured differently in different settings paths, and potentially can be changed at runtime (depending on usage). Change-Id: I50e457bab2d3495e5c69676fe1a0257a5fea3e52 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "qtcprocess.h"
|
||||
|
||||
#include "algorithm.h"
|
||||
#include "environment.h"
|
||||
#include "guard.h"
|
||||
#include "hostosinfo.h"
|
||||
#include "launcherinterface.h"
|
||||
@@ -50,7 +51,7 @@ class MeasureAndRun
|
||||
public:
|
||||
MeasureAndRun(const char *functionName)
|
||||
: m_functionName(functionName)
|
||||
, m_measureProcess(qEnvironmentVariableIsSet("QTC_MEASURE_PROCESS"))
|
||||
, m_measureProcess(qtcEnvironmentVariableIsSet("QTC_MEASURE_PROCESS"))
|
||||
{}
|
||||
template <typename Function, typename... Args>
|
||||
std::invoke_result_t<Function, Args...> measureAndRun(Function &&function, Args&&... args)
|
||||
@@ -507,7 +508,7 @@ private:
|
||||
|
||||
static ProcessImpl defaultProcessImpl()
|
||||
{
|
||||
if (qEnvironmentVariableIsSet("QTC_USE_QPROCESS"))
|
||||
if (qtcEnvironmentVariableIsSet("QTC_USE_QPROCESS"))
|
||||
return ProcessImpl::QProcess;
|
||||
return ProcessImpl::ProcessLauncher;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user