diff options
author | Antti Piira <[email protected]> | 2013-10-23 13:53:38 -0700 |
---|---|---|
committer | The Qt Project <[email protected]> | 2013-10-25 21:35:29 +0200 |
commit | 214d4a70bec89b640a35bbdec7fdd4e5d32e5873 (patch) | |
tree | d47f18c97963cbf76c0e9901d549d613a821bdaf /src | |
parent | 5bd00073b814c080a70ded90472bd0e4f1d4157b (diff) |
Use finalUrl in QQmlTypeLoader::Blob::addPragma to fix a bug.
There was a bug in addPragma where url() was being used instead of
finalUrl(). This resulted in an error finding the type if selectors
were used. This patch includes the fix and adds a unit test to cover
the use case.
Change-Id: I18b6c73e96af2e1464931de76f1f8fd804746d82
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmltypeloader.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index d7ba157f94..eb565babf4 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -1341,7 +1341,7 @@ bool QQmlTypeLoader::Blob::addPragma(const QQmlScript::Pragma &pragma, QList<QQm Q_ASSERT(errors); if (pragma.type == QQmlScript::Pragma::Singleton) { - QUrl myUrl = url(); + QUrl myUrl = finalUrl(); QQmlType *ret = QQmlMetaType::qmlType(myUrl, true); if (!ret) { @@ -1369,7 +1369,7 @@ bool QQmlTypeLoader::Blob::addPragma(const QQmlScript::Pragma &pragma, QList<QQm } else { QQmlError error; error.setDescription(QLatin1String("Invalid pragma")); - error.setUrl(url()); + error.setUrl(finalUrl()); error.setLine(pragma.location.start.line); error.setColumn(pragma.location.start.column); errors->prepend(error); @@ -2086,7 +2086,7 @@ void QQmlTypeData::done() // If the type is CompositeSingleton but there was no pragma Singleton in the // QML file, lets report an error. QQmlType *type = QQmlMetaType::qmlType(url(), true); - if (type && type->isCompositeSingleton() && !m_isSingleton) { + if (!isError() && type && type->isCompositeSingleton() && !m_isSingleton) { QString typeName = type->qmlTypeName(); QQmlError error; |