Make expanders work with subexpanders

Change-Id: I30bad85ce2fbaf1f02043b3d97f657461f5a1995
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
hjk
2014-10-20 23:13:13 +02:00
parent 58be8e6476
commit c6ef3addcc
19 changed files with 247 additions and 130 deletions

View File

@@ -61,6 +61,7 @@ const char MUTABLE_INFO_KEY[] = "PE.Profile.MutableInfo";
const char STICKY_INFO_KEY[] = "PE.Profile.StickyInfo";
namespace ProjectExplorer {
namespace Internal {
// --------------------------------------------------------------------
// KitMacroExpander:
@@ -69,26 +70,20 @@ namespace ProjectExplorer {
class KitMacroExpander : public MacroExpander
{
public:
KitMacroExpander(Kit *kit) : m_kit(kit) {}
bool resolveMacro(const QString &name, QString *ret)
explicit KitMacroExpander(Kit *kit)
{
setDisplayName(QCoreApplication::translate("ProjectExplorer::Kit", "Kit"));
setAccumulating(true);
foreach (KitInformation *ki, KitManager::kitInformation())
if (ki->resolveMacro(m_kit, name, ret))
return true;
return false;
ki->addToMacroExpander(kit, this);
}
private:
Kit *m_kit;
};
// -------------------------------------------------------------------------
// KitPrivate
// -------------------------------------------------------------------------
namespace Internal {
class KitPrivate
{
@@ -663,7 +658,7 @@ bool Kit::hasFeatures(const FeatureSet &features) const
return availableFeatures().contains(features);
}
AbstractMacroExpander *Kit::macroExpander() const
MacroExpander *Kit::macroExpander() const
{
return &d->m_macroExpander;
}