From 624339ea70b5e2373cad77ad34ba11c6f8ffcf96 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 4 Jan 2017 15:12:18 +0100 Subject: [PATCH] qmake: fix missing OTHER_FILES in project tree ... in subdirs projects which actually have any subdirs. that would happen via this mechanism in QmakeProFileNode::evaluate(): first, IncludedPriFile nodes with proFile = null are created for the subdirs. subsequently, this tree is enriched by transforming the reader's included files. that loop iterates over all already created nodes and tries to match them against included files. at nesting level one, this would now run into the nodes created for the subdirs. the code failed to skip over these nodes, and would thus create a bogus node for the .pro file (as it has the parent null in the mapping of included files). this node would not be included into the tree due to the loop prevention in QmakeProFileNode::applyEvaluate() (it obviously had the same file path as its parent), but at the same time it would catch the files meant for the root node due to defeating the fallback in QmakePriFileNode::extractSources(). Task-number: QTCREATORBUG-17473 Change-Id: Ice9f667345148be42297cc21ff0a73058f27cc38 Reviewed-by: Tobias Hunger --- src/plugins/qmakeprojectmanager/qmakenodes.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp index 1ac2f9f5656..8518c8ed011 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp @@ -1848,6 +1848,8 @@ EvalResult *QmakeProFileNode::evaluate(const EvalInput &input) QList toBuild = { &result->includedFiles }; while (!toBuild.isEmpty()) { IncludedPriFile *current = toBuild.takeFirst(); + if (!current->proFile) + continue; // Don't attempt to map subdirs here QVector children = includeFiles.value(current->proFile); foreach (ProFile *child, children) { const Utils::FileName childName = Utils::FileName::fromString(child->fileName()); @@ -1882,6 +1884,8 @@ EvalResult *QmakeProFileNode::evaluate(const EvalInput &input) QList toBuild = { &result->includedFiles }; while (!toBuild.isEmpty()) { IncludedPriFile *current = toBuild.takeFirst(); + if (!current->proFile) + continue; // Don't attempt to map subdirs here QVector children = includeFiles.value(current->proFile); foreach (ProFile *child, children) { const Utils::FileName childName = Utils::FileName::fromString(child->fileName());