From accd2609da1b506309067895a49427aaba63c69c Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 24 Apr 2025 13:38:15 +0200 Subject: [PATCH] Utils: Add documentation for Environment::originalSystemEnvironment() Change-Id: I7791f0b111f5728bd21d2870d6a6793b433d9b37 Reviewed-by: Marcus Tillmanns --- src/libs/utils/environment.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/libs/utils/environment.cpp b/src/libs/utils/environment.cpp index e1a7ee63e31..7dbde6f3c8f 100644 --- a/src/libs/utils/environment.cpp +++ b/src/libs/utils/environment.cpp @@ -200,6 +200,8 @@ void Environment::prependOrSetLibrarySearchPaths(const FilePaths &values) This can be different from the system environment that \QC started in if the user changed it in \uicontrol Preferences > \uicontrol Environment > \uicontrol System > \uicontrol Environment. + + \sa originalSystemEnvironment() */ Environment Environment::systemEnvironment() @@ -208,6 +210,17 @@ Environment Environment::systemEnvironment() return *staticSystemEnvironment(); } +/*! + Returns \QC's original system environment. + + This is the full, unmodified environment that \QC was started with. + Use this environment to start processes that are built alongside \QC + and thus have the same library dependencies. This is particularly + relevant if \QC was started via Squish or another instance of \QC, + i.e. in testing or development contexts. + For all other processes, use \l systemEnvironment() or more specialized + variants such as the build environment, if applicable. +*/ const Environment &Environment::originalSystemEnvironment() { static const Environment env(QProcessEnvironment::systemEnvironment().toStringList());