forked from qt-creator/qt-creator
CppTools: Introduce LocatorData
Until now the locator filters CppLocatorFilter, CppClassesFilter and CppFunctionsFilter used unnecessarily their own SearchSymbols instance. The results were also saved separately, which was unfavorable since e.g. the functions and classes data could be shared. Starting with this patch an instance of LocatorData will serve all mentioned filters. This saves about 20MB of memory after indexing the Qt Creator project. Change-Id: I8a34b67eb9fe0e5c68ba6e7c8f576389c78efc6f Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
committed by
Erik Verbruggen
parent
de1ec22424
commit
fc731a3a67
@@ -40,6 +40,7 @@
|
||||
#include "cpptoolssettings.h"
|
||||
#include "cpptoolsreuse.h"
|
||||
#include "cppprojectfile.h"
|
||||
#include "cpplocatordata.h"
|
||||
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
@@ -101,9 +102,11 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
connect(Core::DocumentManager::instance(), SIGNAL(filesChangedInternally(QStringList)),
|
||||
modelManager, SLOT(updateSourceFiles(QStringList)));
|
||||
|
||||
addAutoReleasedObject(new CppLocatorFilter(modelManager));
|
||||
addAutoReleasedObject(new CppClassesFilter(modelManager));
|
||||
addAutoReleasedObject(new CppFunctionsFilter(modelManager));
|
||||
CppLocatorData *locatorData = new CppLocatorData(modelManager);
|
||||
addAutoReleasedObject(locatorData);
|
||||
addAutoReleasedObject(new CppLocatorFilter(locatorData));
|
||||
addAutoReleasedObject(new CppClassesFilter(locatorData));
|
||||
addAutoReleasedObject(new CppFunctionsFilter(locatorData));
|
||||
addAutoReleasedObject(new CppCurrentDocumentFilter(modelManager));
|
||||
addAutoReleasedObject(new CppFileSettingsPage(m_fileSettings));
|
||||
addAutoReleasedObject(new SymbolsFindFilter(modelManager));
|
||||
|
||||
Reference in New Issue
Block a user