forked from qt-creator/qt-creator
ProjectExplorer: Introduce "extra data" handling for build system
That's meant to replace the per-ProjectNode storage, which cannot (or is hard to be) used correctly for target/buildconfig/buildsystem dependent data. For now just redirect to the node storage to enable the users to port to the new interface before finally changing the storage as such. Change-Id: I14d30b4d68c93bac0f14b787e82d00d1e0ada3b2 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -341,6 +341,20 @@ void BuildSystem::emitBuildSystemUpdated()
|
|||||||
target()->buildSystemUpdated(this);
|
target()->buildSystemUpdated(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BuildSystem::setExtraData(const QString &buildKey, Core::Id dataKey, const QVariant &data)
|
||||||
|
{
|
||||||
|
const ProjectNode *node = d->m_target->project()->findNodeForBuildKey(buildKey);
|
||||||
|
QTC_ASSERT(node, return);
|
||||||
|
node->setData(dataKey, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant BuildSystem::extraData(const QString &buildKey, Core::Id dataKey) const
|
||||||
|
{
|
||||||
|
const ProjectNode *node = d->m_target->project()->findNodeForBuildKey(buildKey);
|
||||||
|
QTC_ASSERT(node, return {});
|
||||||
|
return node->data(dataKey);
|
||||||
|
}
|
||||||
|
|
||||||
QString BuildSystem::disabledReason(const QString &buildKey) const
|
QString BuildSystem::disabledReason(const QString &buildKey) const
|
||||||
{
|
{
|
||||||
if (!hasParsingData()) {
|
if (!hasParsingData()) {
|
||||||
|
@@ -121,6 +121,9 @@ public:
|
|||||||
|
|
||||||
void emitBuildSystemUpdated();
|
void emitBuildSystemUpdated();
|
||||||
|
|
||||||
|
void setExtraData(const QString &buildKey, Core::Id dataKey, const QVariant &data);
|
||||||
|
QVariant extraData(const QString &buildKey, Core::Id dataKey) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// FIXME: Make this private and the BuildSystem a friend
|
// FIXME: Make this private and the BuildSystem a friend
|
||||||
ParseGuard guardParsingRun() { return ParseGuard(this); }
|
ParseGuard guardParsingRun() { return ParseGuard(this); }
|
||||||
|
Reference in New Issue
Block a user