CMake: Show all headers below an included directory in server-mode

Change-Id: I2ff0018a3c92ccb55eca957624cc44f941ec866c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Tobias Hunger
2017-02-07 21:26:13 +01:00
parent bc598ec480
commit c20ae42e20

View File

@@ -683,18 +683,23 @@ void ServerModeReader::addFileGroups(ProjectNode *targetRoot,
toList.append(newFileNodes); toList.append(newFileNodes);
// Add scanned header files: // Add scanned header files:
const FileNameList headerPaths = headers.keys();
for (const IncludePath *i : f->includePaths) { for (const IncludePath *i : f->includePaths) {
const QList<const FileNode *> &headerFiles = headers.value(i->path); for (const FileName &hp : headerPaths) {
const QList<const FileNode *> unseenHeaders = Utils::filtered(headerFiles, [&alreadyListed](const FileNode *fn) { if (hp != i->path && !hp.isChildOf(i->path))
const int count = alreadyListed.count(); continue;
alreadyListed.insert(fn->filePath()); const QList<const FileNode *> &headerFiles = headers.value(hp);
return count != alreadyListed.count(); const QList<const FileNode *> unseenHeaders = Utils::filtered(headerFiles, [&alreadyListed](const FileNode *fn) {
}); const int count = alreadyListed.count();
toList.append(Utils::transform(unseenHeaders, [](const FileNode *fn) -> FileNode * { alreadyListed.insert(fn->filePath());
auto copy = new FileNode(fn->filePath(), fn->fileType(), fn->isGenerated()); return count != alreadyListed.count();
copy->setEnabled(false); });
return copy; toList.append(Utils::transform(unseenHeaders, [](const FileNode *fn) {
})); auto copy = new FileNode(fn->filePath(), fn->fileType(), fn->isGenerated());
copy->setEnabled(false);
return copy;
}));
}
} }
} }