diff options
author | Leandro Melo <leandro.melo@nokia.com> | 2012-01-23 16:08:01 +0100 |
---|---|---|
committer | Leandro Melo <leandro.melo@nokia.com> | 2012-01-23 17:17:00 +0100 |
commit | b97b45a341660edb49f1799f2c052c0f3df76368 (patch) | |
tree | 2ae7ba96218442c65e8c24c4bdde5e36be17dbe3 /src/plugins/cpptools/symbolfinder.h | |
parent | 17425c50f3689148a7b2f89f3b7bdd800de22f0b (diff) | |
download | qt-creator-b97b45a341660edb49f1799f2c052c0f3df76368.tar.gz |
C++: Fix "reference" file in symbol finder
Througout the initial review the singleton was transformed into an
ordinary class, but a error was introduced: The "reference" file was
incorrectly assumed to be the editors file, which is wrong, since
it should be the declaration file.
Change-Id: Iad3e25a690fa8bd07a18184b24b10f8dea965332
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/plugins/cpptools/symbolfinder.h')
-rw-r--r-- | src/plugins/cpptools/symbolfinder.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/plugins/cpptools/symbolfinder.h b/src/plugins/cpptools/symbolfinder.h index dae0429207..23310c399b 100644 --- a/src/plugins/cpptools/symbolfinder.h +++ b/src/plugins/cpptools/symbolfinder.h @@ -8,7 +8,6 @@ #include <QtCore/QHash> #include <QtCore/QStringList> -#include <QtCore/QQueue> #include <QtCore/QMultiMap> #include <QtCore/QSet> @@ -17,8 +16,7 @@ namespace CppTools { class CPPTOOLS_EXPORT SymbolFinder { public: - SymbolFinder(const QString &referenceFileName); - SymbolFinder(const char *referenceFileName, unsigned referenceFileLength); + SymbolFinder(); CPlusPlus::Symbol *findMatchingDefinition(CPlusPlus::Symbol *symbol, const CPlusPlus::Snapshot &snapshot, @@ -37,17 +35,20 @@ public: CPlusPlus::Function *functionType); private: - QStringList fileIterationOrder(const CPlusPlus::Snapshot &snapshot); + QStringList fileIterationOrder(const QString &referenceFile, + const CPlusPlus::Snapshot &snapshot); - void checkCacheConsistency(const CPlusPlus::Snapshot &snapshot); - void clear(const QString &comparingFile); - void insert(const QString &comparingFile); + void checkCacheConsistency(const QString &referenceFile, const CPlusPlus::Snapshot &snapshot); + void clearCache(const QString &referenceFile, const QString &comparingFile); + void insertCache(const QString &referenceFile, const QString &comparingFile); + + void trackCacheUse(const QString &referenceFile); static int computeKey(const QString &referenceFile, const QString &comparingFile); - QMultiMap<int, QString> m_filePriorityCache; - QSet<QString> m_fileMetaCache; - QString m_referenceFile; + QHash<QString, QMultiMap<int, QString> > m_filePriorityCache; + QHash<QString, QSet<QString> > m_fileMetaCache; + QStringList m_recent; }; } // namespace CppTools |