forked from qt-creator/qt-creator
Utils: Read env variable using qtc function in MacroExpander
Change-Id: I2570a526d8b0b8a115b3e06a2d672f7b70d2d970 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "algorithm.h"
|
||||
#include "commandline.h"
|
||||
#include "environment.h"
|
||||
#include "qtcassert.h"
|
||||
#include "stringutils.h"
|
||||
|
||||
@@ -479,8 +480,9 @@ public:
|
||||
GlobalMacroExpander()
|
||||
{
|
||||
setDisplayName(MacroExpander::tr("Global variables"));
|
||||
registerPrefix("Env", MacroExpander::tr("Access environment variables."),
|
||||
[](const QString &value) { return QString::fromLocal8Bit(qgetenv(value.toLocal8Bit())); });
|
||||
registerPrefix("Env",
|
||||
MacroExpander::tr("Access environment variables."),
|
||||
[](const QString &value) { return qtcEnvironmentVariable(value); });
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user