summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppmodelmanager.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2014-11-27 12:11:46 +0100
committerErik Verbruggen <erik.verbruggen@theqtcompany.com>2014-12-17 14:32:17 +0100
commita48adcf9be144eff9f22f30195e834f869fe19b4 (patch)
treee80ea9ea39345dbdeb060a04b95b1c46919396cc /src/plugins/cpptools/cppmodelmanager.cpp
parenta8ece5e9b0b92b36a4b513696afcc8ca6781e447 (diff)
downloadqt-creator-a48adcf9be144eff9f22f30195e834f869fe19b4.tar.gz
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>
Diffstat (limited to 'src/plugins/cpptools/cppmodelmanager.cpp')
-rw-r--r--src/plugins/cpptools/cppmodelmanager.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp
index e2948e9fd7..ed063d99c3 100644
--- a/src/plugins/cpptools/cppmodelmanager.cpp
+++ b/src/plugins/cpptools/cppmodelmanager.cpp
@@ -814,12 +814,12 @@ QList<ProjectPart::Ptr> CppModelManager::projectPart(const QString &fileName) co
QList<ProjectPart::Ptr> CppModelManager::projectPartFromDependencies(const QString &fileName) const
{
QSet<ProjectPart::Ptr> parts;
- const QStringList deps = snapshot().filesDependingOn(fileName);
+ const Utils::FileNameList deps = snapshot().filesDependingOn(fileName);
- {
- QMutexLocker locker(&d->m_projectMutex);
- foreach (const QString &dep, deps)
- parts.unite(QSet<ProjectPart::Ptr>::fromList(d->m_fileToProjectParts.value(dep)));
+ QMutexLocker locker(&d->m_projectMutex);
+ foreach (const Utils::FileName &dep, deps) {
+ parts.unite(QSet<ProjectPart::Ptr>::fromList(
+ d->m_fileToProjectParts.value(dep.toString())));
}
return parts.values();
@@ -963,7 +963,7 @@ void CppModelManager::GC()
}
Snapshot currentSnapshot = snapshot();
- QSet<QString> reachableFiles;
+ QSet<Utils::FileName> reachableFiles;
// The configuration file is part of the project files, which is just fine.
// If single files are open, without any project, then there is no need to
// keep the configuration file around.
@@ -974,9 +974,10 @@ void CppModelManager::GC()
const QString file = todo.last();
todo.removeLast();
- if (reachableFiles.contains(file))
+ const Utils::FileName fileName = Utils::FileName::fromString(file);
+ if (reachableFiles.contains(fileName))
continue;
- reachableFiles.insert(file);
+ reachableFiles.insert(fileName);
if (Document::Ptr doc = currentSnapshot.document(file))
todo += doc->includedFiles();
@@ -986,12 +987,12 @@ void CppModelManager::GC()
QStringList notReachableFiles;
Snapshot newSnapshot;
for (Snapshot::const_iterator it = currentSnapshot.begin(); it != currentSnapshot.end(); ++it) {
- const QString fileName = it.key();
+ const Utils::FileName &fileName = it.key();
if (reachableFiles.contains(fileName))
newSnapshot.insert(it.value());
else
- notReachableFiles.append(fileName);
+ notReachableFiles.append(fileName.toString());
}
// Announce removing files and replace the snapshot