summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/symbolfinder.cpp
diff options
context:
space:
mode:
authorLeandro Melo <leandro.melo@nokia.com>2012-01-23 20:49:00 +0100
committerLeandro Melo <leandro.melo@nokia.com>2012-01-23 21:00:43 +0100
commit35bcccb500d48ea1511675a84f5f1f83185511d3 (patch)
tree2cc8c9b51b5162e7a4abb25837f4cc347e81f32b /src/plugins/cpptools/symbolfinder.cpp
parent09f2c7b8f3faea9f6a06bf0103958cba4be380ca (diff)
downloadqt-creator-35bcccb500d48ea1511675a84f5f1f83185511d3.tar.gz
C++: Remaining fixes in symbol finder
Should have gone in the previous fix commit... Change-Id: Ibca55cbd6fd58caee7d61f5e8f8c37f67391c597 Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
Diffstat (limited to 'src/plugins/cpptools/symbolfinder.cpp')
-rw-r--r--src/plugins/cpptools/symbolfinder.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/cpptools/symbolfinder.cpp b/src/plugins/cpptools/symbolfinder.cpp
index 2f1751f52b..9d84339de6 100644
--- a/src/plugins/cpptools/symbolfinder.cpp
+++ b/src/plugins/cpptools/symbolfinder.cpp
@@ -63,7 +63,7 @@ public:
} // end of anonymous namespace
-static const int kMaxSize = 2;
+static const int kMaxSize = 10;
SymbolFinder::SymbolFinder()
{}
@@ -292,9 +292,11 @@ QStringList SymbolFinder::fileIterationOrder(const QString &referenceFile, const
insertCache(referenceFile, doc->fileName());
}
+ QStringList files = m_filePriorityCache.value(referenceFile).values();
+
trackCacheUse(referenceFile);
- return m_filePriorityCache.value(referenceFile).values();
+ return files;
}
void SymbolFinder::checkCacheConsistency(const QString &referenceFile, const Snapshot &snapshot)
@@ -336,7 +338,7 @@ void SymbolFinder::trackCacheUse(const QString &referenceFile)
// We don't want this to grow too much.
if (m_recent.size() > kMaxSize) {
- const QString &oldest = m_recent.front();
+ const QString &oldest = m_recent.takeFirst();
m_filePriorityCache.remove(oldest);
m_fileMetaCache.remove(oldest);
}