diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-07-03 11:56:49 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-09-15 10:20:58 +0000 |
commit | 43f84b58bfa39964029cb43e0f0d78b90ebaa544 (patch) | |
tree | d8d405a56b8bbb88248a048bbb6a31c26d2223ec /src/qml/qml/qqmlimport.cpp | |
parent | 28f6459933b9672d7854dab7b0e1d95d90cf23bc (diff) |
Return an error if QQmlImportsPrivate::importExtension() fails.
QQmlTypeData expects an error to be returned if loading fails and will
crash if the list of errors is empty.
Change-Id: Idb6dbe35a2ce5f0629be45cc3fd582bbc25bc622
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlimport.cpp')
-rw-r--r-- | src/qml/qml/qqmlimport.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index b17bb0455d..76583846f9 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -1000,13 +1000,21 @@ bool QQmlImportsPrivate::importExtension(const QString &qmldirFilePath, } #else - Q_UNUSED(qmldirFilePath); - Q_UNUSED(uri); Q_UNUSED(vmaj); Q_UNUSED(vmin); Q_UNUSED(database); Q_UNUSED(qmldir); - Q_UNUSED(errors); + + if (errors) { + QQmlError error; + error.setDescription( + QQmlImportDatabase::tr( + "plugin cannot be loaded for module \"%1\": library loading is disabled") + .arg(uri)); + error.setUrl(QUrl::fromLocalFile(qmldirFilePath)); + errors->prepend(error); + } + return false; #endif // QT_NO_LIBRARY return true; |