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,20 +683,25 @@ 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) {
if (hp != i->path && !hp.isChildOf(i->path))
continue;
const QList<const FileNode *> &headerFiles = headers.value(hp);
const QList<const FileNode *> unseenHeaders = Utils::filtered(headerFiles, [&alreadyListed](const FileNode *fn) { const QList<const FileNode *> unseenHeaders = Utils::filtered(headerFiles, [&alreadyListed](const FileNode *fn) {
const int count = alreadyListed.count(); const int count = alreadyListed.count();
alreadyListed.insert(fn->filePath()); alreadyListed.insert(fn->filePath());
return count != alreadyListed.count(); return count != alreadyListed.count();
}); });
toList.append(Utils::transform(unseenHeaders, [](const FileNode *fn) -> FileNode * { toList.append(Utils::transform(unseenHeaders, [](const FileNode *fn) {
auto copy = new FileNode(fn->filePath(), fn->fileType(), fn->isGenerated()); auto copy = new FileNode(fn->filePath(), fn->fileType(), fn->isGenerated());
copy->setEnabled(false); copy->setEnabled(false);
return copy; return copy;
})); }));
} }
} }
}
// Split up files in groups (based on location): // Split up files in groups (based on location):
QList<FileNode *> sourceFileNodes; QList<FileNode *> sourceFileNodes;