OSDN Git Service

QmlDesigner.rewriter: complain about Link errors
authorThomas Hartmann <Thomas.Hartmann@nokia.com>
Tue, 1 Mar 2011 14:01:34 +0000 (15:01 +0100)
committerThomas Hartmann <Thomas.Hartmann@nokia.com>
Tue, 1 Mar 2011 16:21:04 +0000 (17:21 +0100)
If linking fails we show an error message.

src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp

index bf3e8cb..f0d3d8c 100644 (file)
@@ -243,8 +243,8 @@ public:
         : m_snapshot(snapshot)
         , m_doc(doc)
         , m_context(new Interpreter::Context)
-        , m_lookupContext(LookupContext::create(doc, snapshot, QList<AST::Node*>()))
         , m_link(m_context, doc, snapshot, importPaths)
+        , m_lookupContext(LookupContext::create(doc, snapshot, *m_context, QList<AST::Node*>()))
         , m_scopeBuilder(m_context, doc, snapshot)
     {
     }
@@ -501,12 +501,15 @@ public:
     LookupContext::Ptr lookupContext() const
     { return m_lookupContext; }
 
+    QList<DiagnosticMessage> diagnosticLinkMessages() const
+    { return m_link.diagnosticMessages(); }
+
 private:
     Snapshot m_snapshot;
     Document::Ptr m_doc;
     Interpreter::Context *m_context;
-    LookupContext::Ptr m_lookupContext;
     Link m_link;
+    LookupContext::Ptr m_lookupContext;
     ScopeBuilder m_scopeBuilder;
 };