summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppbaseprojectpartbuilder.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2016-12-14 09:34:35 +0100
committerNikolai Kosjar <nikolai.kosjar@qt.io>2016-12-14 11:34:57 +0000
commitc82d372a41482bfdf578ea7fb2f20a0684ea891a (patch)
tree47a4d2dc5555fb023d752e3a4c508754ef1fb5d2 /src/plugins/cpptools/cppbaseprojectpartbuilder.cpp
parentaca290b2e071d62e6db862989872037294b76260 (diff)
downloadqt-creator-c82d372a41482bfdf578ea7fb2f20a0684ea891a.tar.gz
CppTools: Ensure that the C++ project part is the first one
...for a given file in the ambiguous case (CppModelManager::projectPart). There are several places where the first one will be preferred if there are multiple project parts associated with a project file. Change-Id: Ic01ea06277bc10f872238dcc181a55532b5783be Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/cpptools/cppbaseprojectpartbuilder.cpp')
-rw-r--r--src/plugins/cpptools/cppbaseprojectpartbuilder.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/plugins/cpptools/cppbaseprojectpartbuilder.cpp b/src/plugins/cpptools/cppbaseprojectpartbuilder.cpp
index 2171b9adbf..23e57cb8cf 100644
--- a/src/plugins/cpptools/cppbaseprojectpartbuilder.cpp
+++ b/src/plugins/cpptools/cppbaseprojectpartbuilder.cpp
@@ -132,20 +132,6 @@ QList<Core::Id> BaseProjectPartBuilder::createProjectPartsForFiles(const QString
// The ProjextExplorer does not distinguish between other versions than C++ and QML.
languages += ProjectExplorer::Constants::LANG_CXX;
- if (cat.hasCSources()) {
- createProjectPart(cat.cSources(),
- cat.partName("C"),
- ProjectPart::LatestCVersion,
- ProjectPart::NoExtensions);
- }
-
- if (cat.hasObjcSources()) {
- createProjectPart(cat.objcSources(),
- cat.partName("Obj-C"),
- ProjectPart::LatestCVersion,
- ProjectPart::ObjectiveCExtensions);
- }
-
if (cat.hasCxxSources()) {
createProjectPart(cat.cxxSources(),
cat.partName("C++"),
@@ -159,6 +145,20 @@ QList<Core::Id> BaseProjectPartBuilder::createProjectPartsForFiles(const QString
ProjectPart::LatestCxxVersion,
ProjectPart::ObjectiveCExtensions);
}
+
+ if (cat.hasCSources()) {
+ createProjectPart(cat.cSources(),
+ cat.partName("C"),
+ ProjectPart::LatestCVersion,
+ ProjectPart::NoExtensions);
+ }
+
+ if (cat.hasObjcSources()) {
+ createProjectPart(cat.objcSources(),
+ cat.partName("Obj-C"),
+ ProjectPart::LatestCVersion,
+ ProjectPart::ObjectiveCExtensions);
+ }
}
return languages;