Commit 5a351eaa authored by hjk's avatar hjk
Browse files

ProjectExplorer: Add a MacroExpander member in each project



Provide Project:Name there by default, and make it accessible
from the target.

Change-Id: I2faa52dc8c0703f3245cac2ca15b942e3006993a
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 4d3d8bb7
......@@ -42,9 +42,12 @@
#include <coreplugin/icore.h>
#include <projectexplorer/buildmanager.h>
#include <projectexplorer/kitmanager.h>
#include <limits>
#include <utils/qtcassert.h>
#include <utils/algorithm.h>
#include <utils/macroexpander.h>
#include <utils/qtcassert.h>
#include <limits>
/*!
\class ProjectExplorer::Project
......@@ -98,6 +101,8 @@ public:
KitMatcher m_requiredKitMatcher;
KitMatcher m_preferredKitMatcher;
Utils::MacroExpander m_macroExpander;
};
ProjectPrivate::ProjectPrivate() :
......@@ -109,7 +114,11 @@ ProjectPrivate::~ProjectPrivate()
{ delete m_accessor; }
Project::Project() : d(new ProjectPrivate)
{ }
{
d->m_macroExpander.setDisplayName(tr("Project"));
d->m_macroExpander.registerVariable("Project:Name", tr("Project Name"),
[this] { return displayName(); });
}
Project::~Project()
{
......@@ -516,6 +525,11 @@ void Project::setup(QList<const BuildInfo *> infoList)
}
}
Utils::MacroExpander *Project::macroExpander() const
{
return &d->m_macroExpander;
}
ProjectImporter *Project::createProjectImporter() const
{
return 0;
......
......@@ -45,6 +45,8 @@ class IDocument;
class Context;
}
namespace Utils { class MacroExpander; }
namespace ProjectExplorer {
class BuildInfo;
......@@ -141,6 +143,7 @@ public:
virtual bool needsSpecialDeployment() const;
void setup(QList<const BuildInfo *> infoList);
Utils::MacroExpander *macroExpander() const;
signals:
void displayNameChanged();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment