From 786c131beb49152f76c570df49f5d514e8110205 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 26 Nov 2020 08:57:30 +0100 Subject: [PATCH] ClangTools: compare file names host os case sensitive Change-Id: I31b889ca5e722bd565bde9b742e24da39151e8bc Reviewed-by: Christian Stenger --- .../clangtools/documentclangtoolrunner.cpp | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/plugins/clangtools/documentclangtoolrunner.cpp b/src/plugins/clangtools/documentclangtoolrunner.cpp index 0f5e4da958b..1b3bf945394 100644 --- a/src/plugins/clangtools/documentclangtoolrunner.cpp +++ b/src/plugins/clangtools/documentclangtoolrunner.cpp @@ -150,22 +150,17 @@ static FileInfo getFileInfo(const Utils::FilePath &file, ProjectExplorer::Projec QTC_ASSERT(projectFile.kind != CppTools::ProjectFile::Unsupported, continue); if (projectFile.path == CppTools::CppModelManager::configurationFileName()) continue; - if (file.toString() != projectFile.path) + const auto projectFilePath = Utils::FilePath::fromString(projectFile.path); + if (file != projectFilePath) continue; if (!projectFile.active) continue; - if (projectPart->buildTargetType != ProjectExplorer::BuildTargetType::Unknown) { - // found the best candidate, early return - return FileInfo(Utils::FilePath::fromString(projectFile.path), - projectFile.kind, - projectPart); - } - if (candidate.projectPart.isNull()) { - // found at least something but keep looking for better candidates - candidate = FileInfo(Utils::FilePath::fromString(projectFile.path), - projectFile.kind, - projectPart); - } + // found the best candidate, early return + if (projectPart->buildTargetType != ProjectExplorer::BuildTargetType::Unknown) + return FileInfo(projectFilePath, projectFile.kind, projectPart); + // found something but keep looking for better candidates + if (candidate.projectPart.isNull()) + candidate = FileInfo(projectFilePath, projectFile.kind, projectPart); } }