From 63fe568b9b36de9a3ddd72da45ef193d7471224f Mon Sep 17 00:00:00 2001 From: Sergey Shambir Date: Mon, 4 Mar 2013 01:30:46 +0400 Subject: 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 Reviewed-by: Tobias Hunger Reviewed-by: Daniel Teske --- src/plugins/cppeditor/cppquickfixes.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/plugins/cppeditor/cppquickfixes.cpp') diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 5454753f3c..1182a19269 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -1688,17 +1688,19 @@ void AddIncludeForUndefinedIdentifier::match(const CppQuickFixInterface &interfa QList 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; } } -- cgit v1.2.1