forked from qt-creator/qt-creator
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: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -42,9 +42,12 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <projectexplorer/buildmanager.h>
|
#include <projectexplorer/buildmanager.h>
|
||||||
#include <projectexplorer/kitmanager.h>
|
#include <projectexplorer/kitmanager.h>
|
||||||
#include <limits>
|
|
||||||
#include <utils/qtcassert.h>
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
|
#include <utils/macroexpander.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class ProjectExplorer::Project
|
\class ProjectExplorer::Project
|
||||||
@@ -98,6 +101,8 @@ public:
|
|||||||
|
|
||||||
KitMatcher m_requiredKitMatcher;
|
KitMatcher m_requiredKitMatcher;
|
||||||
KitMatcher m_preferredKitMatcher;
|
KitMatcher m_preferredKitMatcher;
|
||||||
|
|
||||||
|
Utils::MacroExpander m_macroExpander;
|
||||||
};
|
};
|
||||||
|
|
||||||
ProjectPrivate::ProjectPrivate() :
|
ProjectPrivate::ProjectPrivate() :
|
||||||
@@ -109,7 +114,11 @@ ProjectPrivate::~ProjectPrivate()
|
|||||||
{ delete m_accessor; }
|
{ delete m_accessor; }
|
||||||
|
|
||||||
Project::Project() : d(new ProjectPrivate)
|
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()
|
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
|
ProjectImporter *Project::createProjectImporter() const
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ class IDocument;
|
|||||||
class Context;
|
class Context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace Utils { class MacroExpander; }
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
class BuildInfo;
|
class BuildInfo;
|
||||||
@@ -141,6 +143,7 @@ public:
|
|||||||
virtual bool needsSpecialDeployment() const;
|
virtual bool needsSpecialDeployment() const;
|
||||||
|
|
||||||
void setup(QList<const BuildInfo *> infoList);
|
void setup(QList<const BuildInfo *> infoList);
|
||||||
|
Utils::MacroExpander *macroExpander() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void displayNameChanged();
|
void displayNameChanged();
|
||||||
|
|||||||
Reference in New Issue
Block a user