Commit af1231b6 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.SubComponentManager: We have to use importPaths



Otherwise we skip items derived from types only available via imports.

Change-Id: I102a4843652029dff777e12594efc4d5e5e50999
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@digia.com>
parent 2ee3bae4
...@@ -108,7 +108,7 @@ static inline bool checkIfDerivedFromItem(const QString &fileName) ...@@ -108,7 +108,7 @@ static inline bool checkIfDerivedFromItem(const QString &fileName)
snapshot.insert(document); snapshot.insert(document);
QmlJS::Link link(snapshot, QStringList(), QmlJS::ModelManagerInterface::instance()->builtins(document)); QmlJS::Link link(snapshot, modelManager->importPaths(), QmlJS::ModelManagerInterface::instance()->builtins(document));
QList<QmlJS::DiagnosticMessage> diagnosticLinkMessages; QList<QmlJS::DiagnosticMessage> diagnosticLinkMessages;
QmlJS::ContextPtr context = link(document, &diagnosticLinkMessages); QmlJS::ContextPtr context = link(document, &diagnosticLinkMessages);
...@@ -123,15 +123,7 @@ static inline bool checkIfDerivedFromItem(const QString &fileName) ...@@ -123,15 +123,7 @@ static inline bool checkIfDerivedFromItem(const QString &fileName)
if (!definition) if (!definition)
return false; return false;
QString fullTypeName; const QmlJS::ObjectValue *objectValue = context->lookupType(document.data(), definition->qualifiedTypeNameId);
for (QmlJS::AST::UiQualifiedId *iter = definition->qualifiedTypeNameId; iter; iter = iter->next)
if (!iter->name.isEmpty())
fullTypeName += iter->name.toString() + QLatin1Char('.');
if (fullTypeName.endsWith(QLatin1Char('.')))
fullTypeName.chop(1);
const QmlJS::ObjectValue *objectValue = context->lookupType(document.data(), fullTypeName.split('.'));
QList<const QmlJS::ObjectValue *> prototypes = QmlJS::PrototypeIterator(objectValue, context).all(); QList<const QmlJS::ObjectValue *> prototypes = QmlJS::PrototypeIterator(objectValue, context).all();
......
Supports Markdown
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