QmlJsCodeModel: Respect QT_NO_CODE_INDEXER environment variable

setting QT_NO_CODE_INDEXER = 1 disables the qmljs code model,
as consequence the qml designer will not work with this setting.

Change-Id: I71a2989b14e55e4d130463edd4a6459dee3cbd3d
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Daniel Teske
2014-09-08 17:59:25 +02:00
committed by Fawzi Mohamed
parent 9090176d38
commit 109228fa62
2 changed files with 9 additions and 1 deletions

View File

@@ -100,6 +100,7 @@ ModelManagerInterface::ModelManagerInterface(QObject *parent)
m_defaultProject(0),
m_pluginDumper(new PluginDumper(this))
{
m_indexerEnabled = qgetenv("QTC_NO_CODE_INDEXER") != "1";
m_synchronizer.setCancelOnWait(true);
m_updateCppQmlTypesTimer = new QTimer(this);
@@ -287,6 +288,8 @@ Snapshot ModelManagerInterface::newestSnapshot() const
void ModelManagerInterface::updateSourceFiles(const QStringList &files,
bool emitDocumentOnDiskChanged)
{
if (!m_indexerEnabled)
return;
refreshSourceFiles(files, emitDocumentOnDiskChanged);
}
@@ -505,7 +508,7 @@ ModelManagerInterface::ProjectInfo ModelManagerInterface::projectInfo(
void ModelManagerInterface::updateProjectInfo(const ProjectInfo &pinfo, ProjectExplorer::Project *p)
{
if (! pinfo.isValid() || !p)
if (! pinfo.isValid() || !p || !m_indexerEnabled)
return;
Snapshot snapshot;
@@ -1044,6 +1047,8 @@ QmlLanguageBundles ModelManagerInterface::extendedBundles() const
void ModelManagerInterface::maybeScan(const PathsAndLanguages &importPaths)
{
if (!m_indexerEnabled)
return;
PathsAndLanguages pathToScan;
{
QMutexLocker l(&m_mutex);
@@ -1076,6 +1081,8 @@ void ModelManagerInterface::maybeScan(const PathsAndLanguages &importPaths)
void ModelManagerInterface::updateImportPaths()
{
if (!m_indexerEnabled)
return;
PathsAndLanguages allImportPaths;
QmlLanguageBundles activeBundles;
QmlLanguageBundles extendedBundles;