From 6d47ce17cb0232eef286513e8cc40218440f613f Mon Sep 17 00:00:00 2001 From: hjk Date: Sun, 26 Oct 2014 12:54:27 +0100 Subject: [PATCH] Expand CurrentKit:* also in local kit expanders This provides the same global fall back as the global expander without relying on the currentKit() discovery process there. Change-Id: I6f62e58c086ad45fa76acfdf5e0a273ff3fa86e9 Task-number: QTCREATORBUG-13231 Reviewed-by: Eike Ziller Reviewed-by: Robert Loehning --- src/plugins/projectexplorer/kit.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/plugins/projectexplorer/kit.cpp b/src/plugins/projectexplorer/kit.cpp index d6e25b5206d..4fb9e97fbd7 100644 --- a/src/plugins/projectexplorer/kit.cpp +++ b/src/plugins/projectexplorer/kit.cpp @@ -33,6 +33,7 @@ #include "kitmanager.h" #include "ioutputparser.h" #include "osparser.h" +#include "projectexplorerconstants.h" #include #include @@ -97,6 +98,18 @@ public: [this]() { return m_fileSystemFriendlyName; }); foreach (KitInformation *ki, KitManager::kitInformation()) ki->addToMacroExpander(kit, &m_macroExpander); + + // This provides the same global fall back as the global expander + // without relying on the currentKit() discovery process there. + m_macroExpander.registerVariable(Constants::VAR_CURRENTKIT_NAME, + tr("The currently active kit's name."), + [kit] { return kit->displayName(); }); + m_macroExpander.registerVariable(Constants::VAR_CURRENTKIT_FILESYSTEMNAME, + tr("The currently active kit's name in a filesystem friendly version."), + [kit] { return kit->fileSystemFriendlyName(); }); + m_macroExpander.registerVariable(Constants::VAR_CURRENTKIT_ID, + tr("The currently active kit's id."), + [kit] { return kit->id().toString(); }); } QString m_unexpandedDisplayName;