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:
hjk
2020-04-01 09:30:07 +02:00
parent e076ed50ac
commit c2627298d8
2 changed files with 17 additions and 0 deletions

View File

@@ -341,6 +341,20 @@ void BuildSystem::emitBuildSystemUpdated()
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
{
if (!hasParsingData()) {

View File

@@ -121,6 +121,9 @@ public:
void emitBuildSystemUpdated();
void setExtraData(const QString &buildKey, Core::Id dataKey, const QVariant &data);
QVariant extraData(const QString &buildKey, Core::Id dataKey) const;
public:
// FIXME: Make this private and the BuildSystem a friend
ParseGuard guardParsingRun() { return ParseGuard(this); }