Commit ff7752ee authored by Tobias Hunger's avatar Tobias Hunger

ProjectTree: Handle containerNode in ProjectTree::hasNode

This fixes e.g. "Add Existing Files..." triggered on the top-level
node of a project.

Task-number: QTCREATORBUG-18896
Change-Id: I763e9a31edbcfd8ac9a4f8b8b30ef885789ad1a5
Reviewed-by: default avatarhjk <hjk@qt.io>
parent 6d0c167b
......@@ -386,7 +386,9 @@ void ProjectTree::applyTreeManager(FolderNode *folder)
bool ProjectTree::hasNode(const Node *node)
{
return Utils::contains(SessionManager::projects(), [node](const Project *p) {
return p && p->rootProjectNode() && p->rootProjectNode()->findNode([node](const Node *n) { return n == node; });
return p && p->rootProjectNode() && (
p->containerNode() == node
|| p->rootProjectNode()->findNode([node](const Node *n) { return n == node; }));
});
}
......
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