From dff0c9df7aea5745406572bd931cf2036d02fab5 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 22 May 2017 16:29:47 +0200 Subject: [PATCH] Core: Add the "resourcePath" to the global macro expander Example use case: Multiple wizard json files want to reference a shared resource file without using fragile relative paths. Change-Id: I2502083d4c371c25a8b66e7d5d3b4fb9d8697317 Reviewed-by: Leena Miettinen Reviewed-by: Tim Jenssen --- src/plugins/coreplugin/coreplugin.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index ff2ad7443bf..fed19490ca6 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -193,6 +193,8 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage) []() { return QVariant(Utils::HostOsInfo::isLinuxHost()).toString(); }); expander->registerVariable("HostOs:isUnix", tr("Is Qt Creator running on any unix-based platform?"), []() { return QVariant(Utils::HostOsInfo::isAnyUnixHost()).toString(); }); + expander->registerVariable("IDE:ResourcePath", tr("The directory where Qt Creator finds its pre-installed resources."), + []() { return ICore::resourcePath(); }); expander->registerPrefix("CurrentDate:", tr("The current date (QDate formatstring)."), [](const QString &fmt) { return QDate::currentDate().toString(fmt); }); expander->registerPrefix("CurrentTime:", tr("The current time (QTime formatstring)."),