summaryrefslogtreecommitdiff
path: root/src/plugins/cppcheck/cppcheckoptions.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2022-08-24 14:57:57 +0200
committerEike Ziller <eike.ziller@qt.io>2022-08-30 11:47:05 +0000
commitf8b430c0b25b9f58e94181813137e40c62a6c95c (patch)
treef110c9799c1a65fd6112a92a6b55aca9c9b0a8df /src/plugins/cppcheck/cppcheckoptions.cpp
parent9d026df988fbbbe40c1c29df1ab1e035010f0afe (diff)
downloadqt-creator-f8b430c0b25b9f58e94181813137e40c62a6c95c.tar.gz
Various: 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: I724eecc040e33e249a88243f27e8a9e72e54f24b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/cppcheck/cppcheckoptions.cpp')
-rw-r--r--src/plugins/cppcheck/cppcheckoptions.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/cppcheck/cppcheckoptions.cpp b/src/plugins/cppcheck/cppcheckoptions.cpp
index 74e56b8e81..86b3aa463f 100644
--- a/src/plugins/cppcheck/cppcheckoptions.cpp
+++ b/src/plugins/cppcheck/cppcheckoptions.cpp
@@ -6,6 +6,7 @@
#include "cppchecktool.h"
#include "cppchecktrigger.h"
+#include <utils/environment.h>
#include <utils/flowlayout.h>
#include <utils/hostosinfo.h>
#include <utils/pathchooser.h>
@@ -131,7 +132,7 @@ CppcheckOptionsPage::CppcheckOptionsPage(CppcheckTool &tool, CppcheckTrigger &tr
if (HostOsInfo::isAnyUnixHost()) {
options.binary = "cppcheck";
} else {
- FilePath programFiles = FilePath::fromUserInput(qEnvironmentVariable("PROGRAMFILES"));
+ FilePath programFiles = FilePath::fromUserInput(qtcEnvironmentVariable("PROGRAMFILES"));
if (programFiles.isEmpty())
programFiles = "C:/Program Files";
options.binary = programFiles / "Cppcheck/cppcheck.exe";