From 0a33abf0942448399df6ab1d4c42daa3301b0a7c Mon Sep 17 00:00:00 2001
From: Christian Kamm <christian.d.kamm@nokia.com>
Date: Wed, 8 Sep 2010 16:52:24 +0200
Subject: [PATCH] QmlJS: Fix import path list growing over time.

Reviewed-by: Roberto Raggi
---
 src/plugins/qmljseditor/qmljsmodelmanager.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/plugins/qmljseditor/qmljsmodelmanager.cpp b/src/plugins/qmljseditor/qmljsmodelmanager.cpp
index 479d5b98f5e..2de3c60c76c 100644
--- a/src/plugins/qmljseditor/qmljsmodelmanager.cpp
+++ b/src/plugins/qmljseditor/qmljsmodelmanager.cpp
@@ -506,12 +506,14 @@ void ModelManager::onLoadPluginTypes(const QString &libraryPath, const QString &
 
 void ModelManager::updateImportPaths()
 {
+    m_allImportPaths.clear();
     QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(m_projects);
     while (it.hasNext()) {
         it.next();
         m_allImportPaths += it.value().importPaths;
     }
     m_allImportPaths += m_defaultImportPaths;
+    m_allImportPaths.removeDuplicates();
 
     // check if any file in the snapshot imports something new in the new paths
     Snapshot snapshot = _snapshot;
-- 
GitLab