forked from qt-creator/qt-creator
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:
@@ -683,20 +683,25 @@ void ServerModeReader::addFileGroups(ProjectNode *targetRoot,
|
||||
toList.append(newFileNodes);
|
||||
|
||||
// Add scanned header files:
|
||||
const FileNameList headerPaths = headers.keys();
|
||||
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 int count = alreadyListed.count();
|
||||
alreadyListed.insert(fn->filePath());
|
||||
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());
|
||||
copy->setEnabled(false);
|
||||
return copy;
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Split up files in groups (based on location):
|
||||
QList<FileNode *> sourceFileNodes;
|
||||
|
||||
Reference in New Issue
Block a user