summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2014-10-22 17:37:06 +0200
committerhjk <hjk121@nokiamail.com>2014-10-23 12:58:43 +0200
commit3ce62fc59e8fdda33e254d57fdd39480c77097dd (patch)
treea1079692d96f227c55a7bd57c3e35387b807885c /src
parentd5246a069b50ddb32ebce9e82da6f7f749d8b202 (diff)
downloadqt-creator-3ce62fc59e8fdda33e254d57fdd39480c77097dd.tar.gz
Dissolve KitMacroExpander class
It's a normal MacroExpander by now, with some extra setup code that's used only in one place. Change-Id: I97244b93d5c165245b02748508c7fdef1b191582 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/projectexplorer/kit.cpp26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/plugins/projectexplorer/kit.cpp b/src/plugins/projectexplorer/kit.cpp
index 582eb464d5..d6e25b5206 100644
--- a/src/plugins/projectexplorer/kit.cpp
+++ b/src/plugins/projectexplorer/kit.cpp
@@ -63,22 +63,6 @@ const char STICKY_INFO_KEY[] = "PE.Profile.StickyInfo";
namespace ProjectExplorer {
namespace Internal {
-// --------------------------------------------------------------------
-// KitMacroExpander:
-// --------------------------------------------------------------------
-
-class KitMacroExpander : public MacroExpander
-{
-public:
- explicit KitMacroExpander(Kit *kit)
- {
- setAccumulating(true);
-
- foreach (KitInformation *ki, KitManager::kitInformation())
- ki->addToMacroExpander(kit, this);
- }
-};
-
// -------------------------------------------------------------------------
// KitPrivate
// -------------------------------------------------------------------------
@@ -89,7 +73,7 @@ class KitPrivate
Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::Kit)
public:
- KitPrivate(Id id, Kit *k) :
+ KitPrivate(Id id, Kit *kit) :
m_id(id),
m_nestedBlockingLevel(0),
m_autodetected(false),
@@ -97,8 +81,7 @@ public:
m_isValid(true),
m_hasWarning(false),
m_hasValidityInfo(false),
- m_mustNotify(false),
- m_macroExpander(k)
+ m_mustNotify(false)
{
if (!id.isValid())
m_id = Id::fromString(QUuid::createUuid().toString());
@@ -107,10 +90,13 @@ public:
m_iconPath = FileName::fromLatin1(":///DESKTOP///");
m_macroExpander.setDisplayName(tr("Kit"));
+ m_macroExpander.setAccumulating(true);
m_macroExpander.registerVariable("Kit:Id", tr("Kit ID"),
[this]() { return m_id.toString(); });
m_macroExpander.registerVariable("Kit:FileSystemName", tr("Kit filesystem-friendly name"),
[this]() { return m_fileSystemFriendlyName; });
+ foreach (KitInformation *ki, KitManager::kitInformation())
+ ki->addToMacroExpander(kit, &m_macroExpander);
}
QString m_unexpandedDisplayName;
@@ -130,7 +116,7 @@ public:
QHash<Core::Id, QVariant> m_data;
QSet<Core::Id> m_sticky;
QSet<Core::Id> m_mutable;
- KitMacroExpander m_macroExpander;
+ MacroExpander m_macroExpander;
};
} // namespace Internal