forked from qt-creator/qt-creator
ProjectExplorer: Reduce qmake specific logic
- add a QString FileNode::buildKey(), returning the build key
for a build represented by that node, if any.
* for QmakeProFileNodes the build key is traditionally equal
to the file name, so use that.
* for QbsProductNode use the uniqueProductName()
- add a Project::findNodeForBuildKey(QString buildKey) convenience
function searching a Project(!)Node matching that build key.
That's the only use case there is right now, and I see no reason
yet to travers all files (yet).
Change-Id: I388c0e06c03111e12d630899d762448e974a5737
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -872,6 +872,15 @@ bool Project::hasParsingData() const
|
||||
return d->m_hasParsingData;
|
||||
}
|
||||
|
||||
const ProjectNode *Project::findNodeForBuildKey(const QString &buildKey) const
|
||||
{
|
||||
const ProjectNode *result = nullptr;
|
||||
d->m_rootProjectNode->forEachProjectNode([buildKey](const ProjectNode *node) {
|
||||
return node->buildKey() == buildKey;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
ProjectImporter *Project::projectImporter() const
|
||||
{
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user