forked from qt-creator/qt-creator
C++: use a global string table for SearchSymbols.
This string table uniques strings, so that multiple identical strings share their contents. It is used by the locator and the symbol searcher, and will later be used by the class view. Change-Id: Ib8b50f69bbf994d0d7a39b66dc8caf1a3d9bfb42 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
@@ -27,8 +27,8 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#include "cpplocatordata.h"
|
||||
#include "cpptoolsplugin.h"
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace CppTools::Internal;
|
||||
@@ -37,6 +37,8 @@ static const int MaxPendingDocuments = 10;
|
||||
|
||||
CppLocatorData::CppLocatorData(CppModelManager *modelManager)
|
||||
: m_modelManager(modelManager)
|
||||
, m_strings(CppToolsPlugin::stringTable())
|
||||
, m_search(m_strings)
|
||||
, m_pendingDocumentsMutex(QMutex::Recursive)
|
||||
{
|
||||
m_search.setSymbolsToSearchFor(SymbolSearcher::Enums
|
||||
@@ -104,8 +106,9 @@ void CppLocatorData::onAboutToRemoveFiles(const QStringList &files)
|
||||
m_allEnums.remove(file);
|
||||
m_allClasses.remove(file);
|
||||
m_allFunctions.remove(file);
|
||||
removeFilePath(file);
|
||||
}
|
||||
|
||||
m_strings.scheduleGC();
|
||||
}
|
||||
|
||||
void CppLocatorData::flushPendingDocument(bool force)
|
||||
|
Reference in New Issue
Block a user