QbsProjectManager: Fix false positives when classifying files

... for the C++ code model. In particular, a file ending in ".h" must
not be unconditionally classified as an "ambiguous header", but only if
it has the "hpp" tag.

Change-Id: I33a463de78525fb965e781b4b75d1e088c055c3d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Christian Kandeler
2017-01-24 15:37:28 +01:00
parent 0b8df41387
commit 1b67f9eafd

View File

@@ -752,10 +752,11 @@ void QbsProject::updateDocuments(const QSet<QString> &files)
static CppTools::ProjectFile::Kind cppFileType(const qbs::ArtifactData &sourceFile)
{
if (sourceFile.fileTags().contains(QLatin1String("hpp"))) {
if (CppTools::ProjectFile::isAmbiguousHeader(sourceFile.filePath()))
return CppTools::ProjectFile::AmbiguousHeader;
if (sourceFile.fileTags().contains(QLatin1String("hpp")))
return CppTools::ProjectFile::CXXHeader;
}
if (sourceFile.fileTags().contains(QLatin1String("cpp")))
return CppTools::ProjectFile::CXXSource;
if (sourceFile.fileTags().contains(QLatin1String("c")))