From f27b332f9cdd8a31fa6f429414149f3d6c4ceec6 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Thu, 15 Dec 2016 14:09:45 +0100 Subject: [PATCH] CMake: Always put in a CMakeLists.txt file Even if there was none found by the project reader. This can happen when the cmake binary can not be started at all with the server-mode reader. I wanted to avoid just creating this node as that does mess with the expansion state of the tree. But considering that we know that the tree is empty otherwise that should actually not be a problem. Change-Id: I5ae5ed3e2fa7eebdfc1f9b7d55d70417abfcd125 Reviewed-by: Alessandro Portale --- src/plugins/cmakeprojectmanager/builddirmanager.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/builddirmanager.cpp b/src/plugins/cmakeprojectmanager/builddirmanager.cpp index 1f5efd833f3..ff05db54aff 100644 --- a/src/plugins/cmakeprojectmanager/builddirmanager.cpp +++ b/src/plugins/cmakeprojectmanager/builddirmanager.cpp @@ -287,14 +287,8 @@ void BuildDirManager::generateProjectTree(CMakeListsNode *root, const QListfileNodes().isEmpty() && root->folderNodes().isEmpty() - && root->projectNodes().isEmpty()) { - const FileNode *cm = Utils::findOrDefault(allFiles, [&projectFile](const FileNode *fn) { - return fn->filePath() == projectFile; - }); - if (cm) { - root->addFileNodes({ new FileNode(*cm) }); - } - } + && root->projectNodes().isEmpty()) + root->addFileNodes({ new FileNode(projectFile, FileType::Project, false) }); } QSet BuildDirManager::updateCodeModel(CppTools::ProjectPartBuilder &ppBuilder)