ProjectExplorer: Add method to find ProjectNodes

Change-Id: Ib8056bd7d5603ced67c3ce3514d49ec51d05e2cf
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tobias Hunger
2016-11-07 13:56:57 +01:00
parent ad003363b7
commit f9e9357756
2 changed files with 15 additions and 10 deletions

View File

@@ -730,11 +730,6 @@ QString ProjectNode::vcsTopic() const
return QString();
}
QList<ProjectNode*> ProjectNode::projectNodes() const
{
return m_projectNodes;
}
bool ProjectNode::canAddSubProject(const QString &proFilePath) const
{
Q_UNUSED(proFilePath)
@@ -811,6 +806,18 @@ void ProjectNode::accept(NodesVisitor *visitor)
folder->accept(visitor);
}
ProjectNode *ProjectNode::projectNode(const Utils::FileName &file) const
{
return Utils::findOrDefault(m_projectNodes, [&file](const ProjectNode *fn) {
return fn->filePath() == file;
});
}
QList<ProjectNode*> ProjectNode::projectNodes() const
{
return m_projectNodes;
}
/*!
Adds project nodes specified by \a subProjects to the node hierarchy and
emits the corresponding signals.