Commit 15ee71b3 authored by Roberto Raggi's avatar Roberto Raggi

Disable the indexer when m_indexerEnabled is false.

parent 3fb1bc46
...@@ -591,8 +591,6 @@ Document::Ptr CppPreprocessor::switchDocument(Document::Ptr doc) ...@@ -591,8 +591,6 @@ Document::Ptr CppPreprocessor::switchDocument(Document::Ptr doc)
return previousDoc; return previousDoc;
} }
void CppTools::CppModelManagerInterface::updateModifiedSourceFiles() void CppTools::CppModelManagerInterface::updateModifiedSourceFiles()
{ {
const Snapshot snapshot = this->snapshot(); const Snapshot snapshot = this->snapshot();
...@@ -633,6 +631,7 @@ CppModelManager::CppModelManager(QObject *parent) ...@@ -633,6 +631,7 @@ CppModelManager::CppModelManager(QObject *parent)
: CppModelManagerInterface(parent) : CppModelManagerInterface(parent)
{ {
m_findReferences = new CppFindReferences(this); m_findReferences = new CppFindReferences(this);
m_indexerEnabled = qgetenv("QTCREATOR_NO_CODE_INDEXER").isNull();
m_revision = 0; m_revision = 0;
m_synchronizer.setCancelOnWait(true); m_synchronizer.setCancelOnWait(true);
...@@ -848,7 +847,7 @@ void CppModelManager::updateProjectInfo(const ProjectInfo &pinfo) ...@@ -848,7 +847,7 @@ void CppModelManager::updateProjectInfo(const ProjectInfo &pinfo)
m_projects.insert(pinfo.project, pinfo); m_projects.insert(pinfo.project, pinfo);
m_dirty = true; m_dirty = true;
if (qgetenv("QTCREATOR_NO_CODE_INDEXER").isNull()) { if (m_indexerEnabled) {
QFuture<void> result = QtConcurrent::run(&CppModelManager::updateIncludesInPaths, QFuture<void> result = QtConcurrent::run(&CppModelManager::updateIncludesInPaths,
this, this,
pinfo.includePaths, pinfo.includePaths,
...@@ -870,7 +869,7 @@ QStringList CppModelManager::includesInPath(const QString &path) const ...@@ -870,7 +869,7 @@ QStringList CppModelManager::includesInPath(const QString &path) const
QFuture<void> CppModelManager::refreshSourceFiles(const QStringList &sourceFiles) QFuture<void> CppModelManager::refreshSourceFiles(const QStringList &sourceFiles)
{ {
if (! sourceFiles.isEmpty() && qgetenv("QTCREATOR_NO_CODE_INDEXER").isNull()) { if (! sourceFiles.isEmpty() && m_indexerEnabled) {
const QMap<QString, QString> workingCopy = buildWorkingCopyList(); const QMap<QString, QString> workingCopy = buildWorkingCopyList();
CppPreprocessor *preproc = new CppPreprocessor(this); CppPreprocessor *preproc = new CppPreprocessor(this);
...@@ -900,6 +899,7 @@ QFuture<void> CppModelManager::refreshSourceFiles(const QStringList &sourceFiles ...@@ -900,6 +899,7 @@ QFuture<void> CppModelManager::refreshSourceFiles(const QStringList &sourceFiles
m_core->progressManager()->addTask(result, tr("Indexing"), m_core->progressManager()->addTask(result, tr("Indexing"),
CppTools::Constants::TASK_INDEX); CppTools::Constants::TASK_INDEX);
} }
return result; return result;
} }
return QFuture<void>(); return QFuture<void>();
......
...@@ -217,6 +217,7 @@ private: ...@@ -217,6 +217,7 @@ private:
unsigned m_revision; unsigned m_revision;
CppFindReferences *m_findReferences; CppFindReferences *m_findReferences;
bool m_indexerEnabled;
}; };
} // namespace Internal } // namespace Internal
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment