From 836366c18787d6912d1003075b662b61b1d786aa Mon Sep 17 00:00:00 2001
From: Christian Kamm <christian.d.kamm@nokia.com>
Date: Fri, 15 Oct 2010 10:09:40 +0200
Subject: [PATCH] QmlJS: Force a semantic check when library information
 changes.

Task-number: QTCREATORBUG-2640
Reviewed-by: Roberto Raggi
---
 src/libs/qmljs/qmljsmodelmanagerinterface.h | 1 +
 src/plugins/qmljseditor/qmljseditor.cpp     | 2 ++
 src/plugins/qmljseditor/qmljsmodelmanager.h | 1 -
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.h b/src/libs/qmljs/qmljsmodelmanagerinterface.h
index 642e2a06521..ed39a810c3e 100644
--- a/src/libs/qmljs/qmljsmodelmanagerinterface.h
+++ b/src/libs/qmljs/qmljsmodelmanagerinterface.h
@@ -129,6 +129,7 @@ signals:
     void documentUpdated(QmlJS::Document::Ptr doc);
     void documentChangedOnDisk(QmlJS::Document::Ptr doc);
     void aboutToRemoveFiles(const QStringList &files);
+    void libraryInfoUpdated(const QString &path, const QmlJS::LibraryInfo &info);
 };
 
 } // namespace QmlJS
diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp
index 52d6a545b17..39ec9976de1 100644
--- a/src/plugins/qmljseditor/qmljseditor.cpp
+++ b/src/plugins/qmljseditor/qmljseditor.cpp
@@ -749,6 +749,8 @@ QmlJSTextEditor::QmlJSTextEditor(QWidget *parent) :
         m_semanticHighlighter->setModelManager(m_modelManager);
         connect(m_modelManager, SIGNAL(documentUpdated(QmlJS::Document::Ptr)),
                 this, SLOT(onDocumentUpdated(QmlJS::Document::Ptr)));
+        connect(m_modelManager, SIGNAL(libraryInfoUpdated(QString,QmlJS::LibraryInfo)),
+                this, SLOT(forceSemanticRehighlight()));
         connect(this->document(), SIGNAL(modificationChanged(bool)), this, SLOT(modificationChanged(bool)));
     }
 
diff --git a/src/plugins/qmljseditor/qmljsmodelmanager.h b/src/plugins/qmljseditor/qmljsmodelmanager.h
index bda8bd647a4..842ba4a4fd7 100644
--- a/src/plugins/qmljseditor/qmljsmodelmanager.h
+++ b/src/plugins/qmljseditor/qmljsmodelmanager.h
@@ -75,7 +75,6 @@ public:
 
 Q_SIGNALS:
     void projectPathChanged(const QString &projectPath);
-    void libraryInfoUpdated(const QString &path, const QmlJS::LibraryInfo &info);
 
 private Q_SLOTS:
     void onLoadPluginTypes(const QString &libraryPath, const QString &importPath, const QString &importUri);
-- 
GitLab