forked from qt-creator/qt-creator
CppTools: Apply 'static' pattern to StringTable
This also fixes a crash on loading (some?) projects introduced
in 577bf7c08a
.
Change-Id: Ie35d466fa3b84b183118fe93f55393a4c59755de
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "cpplocatordata.h"
|
||||
#include "cpptoolsplugin.h"
|
||||
#include "stringtable.h"
|
||||
|
||||
using namespace CppTools;
|
||||
using namespace CppTools::Internal;
|
||||
@@ -32,9 +32,7 @@ using namespace CppTools::Internal;
|
||||
enum { MaxPendingDocuments = 10 };
|
||||
|
||||
CppLocatorData::CppLocatorData()
|
||||
: m_strings(&CppToolsPlugin::stringTable())
|
||||
, m_search(CppToolsPlugin::stringTable())
|
||||
, m_pendingDocumentsMutex(QMutex::Recursive)
|
||||
: m_pendingDocumentsMutex(QMutex::Recursive)
|
||||
{
|
||||
m_search.setSymbolsToSearchFor(SymbolSearcher::Enums |
|
||||
SymbolSearcher::Classes |
|
||||
@@ -79,7 +77,7 @@ void CppLocatorData::onAboutToRemoveFiles(const QStringList &files)
|
||||
}
|
||||
}
|
||||
|
||||
m_strings->scheduleGC();
|
||||
StringTable::scheduleGC();
|
||||
flushPendingDocument(false);
|
||||
}
|
||||
|
||||
@@ -93,7 +91,7 @@ void CppLocatorData::flushPendingDocument(bool force) const
|
||||
return;
|
||||
|
||||
foreach (CPlusPlus::Document::Ptr doc, m_pendingDocuments)
|
||||
m_infosByFile.insert(findOrInsertFilePath(doc->fileName()), m_search(doc));
|
||||
m_infosByFile.insert(StringTable::insert(doc->fileName()), m_search(doc));
|
||||
|
||||
m_pendingDocuments.clear();
|
||||
m_pendingDocuments.reserve(MaxPendingDocuments);
|
||||
|
Reference in New Issue
Block a user