diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2014-07-29 09:36:00 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2014-07-29 11:41:43 +0200 |
commit | 472a0e505a78fddf5d7ce02b2c6ef8f859926b3e (patch) | |
tree | dee1e65bfff43b9a5106e3fd7673d1c888013547 /src/lib/corelib/language/moduleloader.h | |
parent | 472619b8254a0c29611a8d3673a7dac9bc0eebf1 (diff) |
Clean up module item caches.
The product- and project-specific ones were left-overs from earlier
concepts, so get rid of them. Everything goes into the same "global"
cache now. Also make sure that we cache disabled modules too; the
respective files were always re-read from disk so far.
Change-Id: Ib1dee08dbbfe61b0369772df96122e8eab19741b
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/lib/corelib/language/moduleloader.h')
-rw-r--r-- | src/lib/corelib/language/moduleloader.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/corelib/language/moduleloader.h b/src/lib/corelib/language/moduleloader.h index 67bfa1e07..07e0ab24f 100644 --- a/src/lib/corelib/language/moduleloader.h +++ b/src/lib/corelib/language/moduleloader.h @@ -106,7 +106,14 @@ public: static QString fullModuleName(const QStringList &moduleName); private: - typedef QMap<QPair<QString, QString>, Item *> ModuleItemCache; + struct ItemCacheValue { + explicit ItemCacheValue(Item *module = 0, bool enabled = false) + : module(module), enabled(enabled) {} + Item *module; + bool enabled; + }; + + typedef QMap<QPair<QString, QString>, ItemCacheValue> ModuleItemCache; class ContextBase { @@ -118,7 +125,6 @@ private: Item *item; Item *scope; QStringList extraSearchPaths; - ModuleItemCache moduleItemCache; }; class ProjectContext : public ContextBase @@ -204,7 +210,7 @@ private: Evaluator *m_evaluator; QStringList m_moduleSearchPaths; QMap<QString, QStringList> m_moduleDirListCache; - ModuleItemCache m_globalModuleItemCache; + ModuleItemCache m_modulePrototypeItemCache; QHash<Item *, QSet<QString> > m_validItemPropertyNamesPerItem; QSet<Item *> m_disabledItems; SetupProjectParameters m_parameters; |