CMake: Make sure file node from project is selected

instead of node in file system tree, if it is available in the project.
For that, the nodes in the file system tree must have a higher priority
value than also the project file node.

Fixes: QTCREATORBUG-25493
Change-Id: I984adc0d205b2bac27782135772e49a6df2bbd0f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2021-03-17 17:43:26 +01:00
parent 8fad758f60
commit f348e952b8

View File

@@ -233,7 +233,8 @@ void addFileSystemNodes(ProjectNode *root, const QList<const FileNode *> &allFil
if (!fileSystemNode->isEmpty()) {
// make file system nodes less probable to be selected when syncing with the current document
fileSystemNode->forEachGenericNode([](Node *n) { n->setPriority(n->priority() + 10); });
fileSystemNode->forEachGenericNode(
[](Node *n) { n->setPriority(n->priority() + Node::DefaultProjectFilePriority + 1); });
root->addNode(std::move(fileSystemNode));
}
}