C++: handle case-insensitive file names in the CPlusPlus::Snapshot

... by keying on Utils::FileName

Task-number: QTCREATORBUG-12390
Change-Id: Ia98afb5a9160a7fd9225a2f9e02539ff3c35ae86
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
Erik Verbruggen
2014-11-27 12:11:46 +01:00
committed by Erik Verbruggen
parent a8ece5e9b0
commit a48adcf9be
16 changed files with 141 additions and 78 deletions

View File

@@ -1907,12 +1907,13 @@ void AddIncludeForUndefinedIdentifier::match(const CppQuickFixInterface &interfa
Snapshot localForwardHeaders = forwardHeaders;
localForwardHeaders.insert(interface.snapshot().document(info->fileName()));
QStringList headerAndItsForwardingHeaders;
headerAndItsForwardingHeaders << info->fileName();
Utils::FileNameList headerAndItsForwardingHeaders;
headerAndItsForwardingHeaders << Utils::FileName::fromString(info->fileName());
headerAndItsForwardingHeaders += localForwardHeaders.filesDependingOn(info->fileName());
foreach (const QString &header, headerAndItsForwardingHeaders) {
const QString include = findShortestInclude(currentDocumentFilePath, header,
foreach (const Utils::FileName &header, headerAndItsForwardingHeaders) {
const QString include = findShortestInclude(currentDocumentFilePath,
header.toString(),
headerPaths);
if (include.size() > 2) {
const QString headerFileName = QFileInfo(info->fileName()).fileName();