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>
This commit is contained in:
Nikolai Kosjar
2016-12-14 09:34:35 +01:00
parent aca290b2e0
commit c82d372a41

View File

@@ -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;