forked from qt-creator/qt-creator
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:
@@ -752,10 +752,11 @@ void QbsProject::updateDocuments(const QSet<QString> &files)
|
||||
|
||||
static CppTools::ProjectFile::Kind cppFileType(const qbs::ArtifactData &sourceFile)
|
||||
{
|
||||
if (CppTools::ProjectFile::isAmbiguousHeader(sourceFile.filePath()))
|
||||
return CppTools::ProjectFile::AmbiguousHeader;
|
||||
if (sourceFile.fileTags().contains(QLatin1String("hpp")))
|
||||
if (sourceFile.fileTags().contains(QLatin1String("hpp"))) {
|
||||
if (CppTools::ProjectFile::isAmbiguousHeader(sourceFile.filePath()))
|
||||
return CppTools::ProjectFile::AmbiguousHeader;
|
||||
return CppTools::ProjectFile::CXXHeader;
|
||||
}
|
||||
if (sourceFile.fileTags().contains(QLatin1String("cpp")))
|
||||
return CppTools::ProjectFile::CXXSource;
|
||||
if (sourceFile.fileTags().contains(QLatin1String("c")))
|
||||
|
||||
Reference in New Issue
Block a user