summaryrefslogtreecommitdiff
path: root/src/plugins/cppeditor/cppquickfixes.cpp
diff options
context:
space:
mode:
authorSergey Shambir <sergey.shambir.auto@gmail.com>2013-03-04 01:30:46 +0400
committerSergey Shambir <sergey.shambir.auto@gmail.com>2013-03-21 17:22:18 +0100
commit63fe568b9b36de9a3ddd72da45ef193d7471224f (patch)
treeb380436f34355a263d841c1190d4750f6c2de970 /src/plugins/cppeditor/cppquickfixes.cpp
parent0c417bbb8e6c34e2dbc594dca70f607dd3dc5c82 (diff)
downloadqt-creator-63fe568b9b36de9a3ddd72da45ef193d7471224f.tar.gz
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>
Diffstat (limited to 'src/plugins/cppeditor/cppquickfixes.cpp')
-rw-r--r--src/plugins/cppeditor/cppquickfixes.cpp12
1 files changed, 7 insertions, 5 deletions
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<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;
}
}