forked from qt-creator/qt-creator
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 <eike.ziller@theqtcompany.com> Reviewed-by: Robert Loehning <robert.loehning@digia.com>
This commit is contained in:
@@ -33,6 +33,7 @@
|
|||||||
#include "kitmanager.h"
|
#include "kitmanager.h"
|
||||||
#include "ioutputparser.h"
|
#include "ioutputparser.h"
|
||||||
#include "osparser.h"
|
#include "osparser.h"
|
||||||
|
#include "projectexplorerconstants.h"
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
@@ -97,6 +98,18 @@ public:
|
|||||||
[this]() { return m_fileSystemFriendlyName; });
|
[this]() { return m_fileSystemFriendlyName; });
|
||||||
foreach (KitInformation *ki, KitManager::kitInformation())
|
foreach (KitInformation *ki, KitManager::kitInformation())
|
||||||
ki->addToMacroExpander(kit, &m_macroExpander);
|
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;
|
QString m_unexpandedDisplayName;
|
||||||
|
|||||||
Reference in New Issue
Block a user