Commit f9e93577 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

ProjectExplorer: Add method to find ProjectNodes



Change-Id: Ib8056bd7d5603ced67c3ce3514d49ec51d05e2cf
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent ad003363
......@@ -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.
......
......@@ -257,9 +257,6 @@ class PROJECTEXPLORER_EXPORT ProjectNode : public FolderNode
public:
QString vcsTopic() const;
// all subFolders that are projects
QList<ProjectNode*> projectNodes() const;
virtual bool canAddSubProject(const QString &proFilePath) const;
virtual bool addSubProjects(const QStringList &proFilePaths);
virtual bool removeSubProjects(const QStringList &proFilePaths);
......@@ -277,8 +274,9 @@ public:
void accept(NodesVisitor *visitor) override;
// to be called in implementation of
// the corresponding public functions
ProjectNode *projectNode(const Utils::FileName &file) const;
// all subFolders that are projects
QList<ProjectNode*> projectNodes() const;
void addProjectNodes(const QList<ProjectNode*> &subProjects);
void removeProjectNodes(const QList<ProjectNode*> &subProjects);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment