forked from qt-creator/qt-creator
CppTools: improved languages support in ProjectPart
Please, read blueprint here: http://qt-project.org/wiki/Blueprint-for-language-specs-system Removed feature from QbsProjectManager: it not longer splits project on separate C and C++ parts, because Qt version used only by clang parser (not native) and can be ignored for pure C and Objective-C without C++. Change-Id: I1c561f7f9f915cc6cb8579d19db74e8352f54c1e Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -1688,17 +1688,19 @@ void AddIncludeForUndefinedIdentifier::match(const CppQuickFixInterface &interfa
|
||||
QList<CppModelManagerInterface::ProjectInfo> projectInfos = modelManager->projectInfos();
|
||||
bool inProject = false;
|
||||
foreach (const CppModelManagerInterface::ProjectInfo &info, projectInfos) {
|
||||
foreach (CppModelManagerInterface::ProjectPart::Ptr part, info.projectParts()) {
|
||||
if (part->sourceFiles.contains(doc->fileName()) || part->objcSourceFiles.contains(doc->fileName()) || part->headerFiles.contains(doc->fileName())) {
|
||||
inProject = true;
|
||||
includePaths += part->includePaths;
|
||||
foreach (ProjectPart::Ptr part, info.projectParts()) {
|
||||
foreach (const ProjectFile &file, part->files) {
|
||||
if (file.path == doc->fileName()) {
|
||||
inProject = true;
|
||||
includePaths += part->includePaths;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!inProject) {
|
||||
// better use all include paths than none
|
||||
foreach (const CppModelManagerInterface::ProjectInfo &info, projectInfos) {
|
||||
foreach (CppModelManagerInterface::ProjectPart::Ptr part, info.projectParts())
|
||||
foreach (ProjectPart::Ptr part, info.projectParts())
|
||||
includePaths += part->includePaths;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user