forked from qt-creator/qt-creator
CppTools: Remove unused additional indexing support object
Its presence is confusing. Change-Id: I61986e970e0f58cded5b97dae2cd28abcdb3ecff Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -173,7 +173,6 @@ public:
|
||||
ModelManagerSupport::Ptr m_activeModelManagerSupport;
|
||||
|
||||
// Indexing
|
||||
CppIndexingSupport *m_indexingSupporter;
|
||||
CppIndexingSupport *m_internalIndexingSupport;
|
||||
bool m_indexerEnabled;
|
||||
|
||||
@@ -644,7 +643,6 @@ CppModelManager::CppModelManager()
|
||||
setObjectName("CppModelManager");
|
||||
ExtensionSystem::PluginManager::addObject(this);
|
||||
|
||||
d->m_indexingSupporter = nullptr;
|
||||
d->m_enableGC = true;
|
||||
|
||||
// Visual C++ has 1MiB, macOSX has 512KiB
|
||||
@@ -968,8 +966,6 @@ QFuture<void> CppModelManager::updateSourceFiles(const QSet<QString> &sourceFile
|
||||
|
||||
const QSet<QString> filteredFiles = tooBigFilesRemoved(sourceFiles, indexerFileSizeLimitInMb());
|
||||
|
||||
if (d->m_indexingSupporter)
|
||||
d->m_indexingSupporter->refreshSourceFiles(filteredFiles, mode);
|
||||
return d->m_internalIndexingSupport->refreshSourceFiles(filteredFiles, mode);
|
||||
}
|
||||
|
||||
@@ -1652,19 +1648,9 @@ BaseEditorDocumentProcessor *CppModelManager::createEditorDocumentProcessor(
|
||||
return d->m_activeModelManagerSupport->createEditorDocumentProcessor(baseTextDocument);
|
||||
}
|
||||
|
||||
void CppModelManager::setIndexingSupport(CppIndexingSupport *indexingSupport)
|
||||
{
|
||||
if (indexingSupport) {
|
||||
if (dynamic_cast<BuiltinIndexingSupport *>(indexingSupport))
|
||||
d->m_indexingSupporter = nullptr;
|
||||
else
|
||||
d->m_indexingSupporter = indexingSupport;
|
||||
}
|
||||
}
|
||||
|
||||
CppIndexingSupport *CppModelManager::indexingSupport()
|
||||
{
|
||||
return d->m_indexingSupporter ? d->m_indexingSupporter : d->m_internalIndexingSupport;
|
||||
return d->m_internalIndexingSupport;
|
||||
}
|
||||
|
||||
QStringList CppModelManager::projectFiles()
|
||||
|
@@ -192,7 +192,6 @@ public:
|
||||
FollowSymbolInterface &followSymbolInterface() const;
|
||||
std::unique_ptr<AbstractOverviewModel> createOverviewModel() const;
|
||||
|
||||
void setIndexingSupport(CppIndexingSupport *indexingSupport);
|
||||
CppIndexingSupport *indexingSupport();
|
||||
|
||||
QStringList projectFiles();
|
||||
|
@@ -86,19 +86,12 @@ public:
|
||||
class SymbolSearcherTestCase : public Tests::TestCase
|
||||
{
|
||||
public:
|
||||
/// Takes no ownership of indexingSupportToUse
|
||||
SymbolSearcherTestCase(const QString &testFile,
|
||||
CppIndexingSupport *indexingSupportToUse,
|
||||
const SymbolSearcher::Parameters &searchParameters,
|
||||
const ResultDataList &expectedResults)
|
||||
: m_indexingSupportToUse(indexingSupportToUse)
|
||||
{
|
||||
QVERIFY(succeededSoFar());
|
||||
|
||||
QVERIFY(m_indexingSupportToUse);
|
||||
QVERIFY(parseFiles(testFile));
|
||||
m_indexingSupportToRestore = m_modelManager->indexingSupport();
|
||||
m_modelManager->setIndexingSupport(m_indexingSupportToUse);
|
||||
|
||||
CppIndexingSupport *indexingSupport = m_modelManager->indexingSupport();
|
||||
const QScopedPointer<SymbolSearcher> symbolSearcher(
|
||||
@@ -109,16 +102,6 @@ public:
|
||||
ResultDataList results = ResultData::fromSearchResultList(search.results());
|
||||
QCOMPARE(results, expectedResults);
|
||||
}
|
||||
|
||||
~SymbolSearcherTestCase()
|
||||
{
|
||||
if (m_indexingSupportToRestore)
|
||||
m_modelManager->setIndexingSupport(m_indexingSupportToRestore);
|
||||
}
|
||||
|
||||
private:
|
||||
CppIndexingSupport *m_indexingSupportToRestore = nullptr;
|
||||
CppIndexingSupport *m_indexingSupportToUse = nullptr;
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
@@ -143,11 +126,7 @@ void CppToolsPlugin::test_builtinsymbolsearcher()
|
||||
QFETCH(SymbolSearcher::Parameters, searchParameters);
|
||||
QFETCH(ResultDataList, expectedResults);
|
||||
|
||||
QScopedPointer<CppIndexingSupport> builtinIndexingSupport(new BuiltinIndexingSupport);
|
||||
SymbolSearcherTestCase(testFile,
|
||||
builtinIndexingSupport.data(),
|
||||
searchParameters,
|
||||
expectedResults);
|
||||
SymbolSearcherTestCase(testFile, searchParameters, expectedResults);
|
||||
}
|
||||
|
||||
void CppToolsPlugin::test_builtinsymbolsearcher_data()
|
||||
|
Reference in New Issue
Block a user