diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-06-29 01:02:07 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-06-29 01:02:07 +0200 |
commit | dd333172e2ade1db6d0af72b4ed44262c2b4d8c7 (patch) | |
tree | 16301a9b938826cf4b78b751907378d96423c5d0 /src/qml/qml/qqmlimport.cpp | |
parent | 3d266d90cb920375bb856844baea290e52355aad (diff) | |
parent | ffeaac704efc9eb85464d0a401d98e28991ec4d3 (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I800f39ea59efd6049d3226ec27b8ecb3f6e9ae28
Diffstat (limited to 'src/qml/qml/qqmlimport.cpp')
-rw-r--r-- | src/qml/qml/qqmlimport.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index 962c92fdb0..1c37894751 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -158,6 +158,8 @@ QQmlType fetchOrCreateTypeForUrl(const QString &urlString, const QHashedStringRe // can guarentee it will live long enough to reach qmlregister. QByteArray buf(unqualifiedtype.toString().toUtf8()); + QQmlMetaTypeRegistrationFailureRecorder failureRecorder; + // Register the type. Note that the URI parameters here are empty; for // file type imports, we do not place them in a URI as we don't // necessarily have a good and unique one (picture a library import, @@ -200,9 +202,9 @@ QQmlType fetchOrCreateTypeForUrl(const QString &urlString, const QHashedStringRe // data. if (!ret.isValid()) { if (!errors) // Cannot list errors properly, just quit - qFatal("%s", QQmlMetaType::typeRegistrationFailures().join('\n').toLatin1().constData()); + qFatal("%s", failureRecorder.failures().join('\n').toLatin1().constData()); QQmlError error; - error.setDescription(QQmlMetaType::typeRegistrationFailures().join('\n')); + error.setDescription(failureRecorder.failures().join('\n')); errors->prepend(error); } return ret; @@ -2022,7 +2024,7 @@ bool QQmlImportDatabase::registerPluginTypes(QObject *instance, const QString &b const QByteArray bytes = uri.toUtf8(); const char *moduleId = bytes.constData(); - QStringList registrationFailures; + QQmlMetaTypeRegistrationFailureRecorder failureRecorder; { // Create a scope for QWriteLocker to keep it as narrow as possible, and // to ensure that we release it before the call to initalizeEngine below @@ -2064,14 +2066,12 @@ bool QQmlImportDatabase::registerPluginTypes(QObject *instance, const QString &b } iface->registerTypes(moduleId); - - registrationFailures = QQmlMetaType::typeRegistrationFailures(); QQmlMetaType::setTypeRegistrationNamespace(QString()); } // QWriteLocker lock(QQmlMetaType::typeRegistrationLock()) - if (!registrationFailures.isEmpty()) { + if (!failureRecorder.failures().isEmpty()) { if (errors) { - for (const QString &failure : qAsConst(registrationFailures)) { + for (const QString &failure : failureRecorder.failures()) { QQmlError error; error.setDescription(failure); errors->prepend(error); |