diff options
author | Lorn Potter <lorn.potter@gmail.com> | 2018-06-06 14:12:23 +1000 |
---|---|---|
committer | Lorn Potter <lorn.potter@gmail.com> | 2018-06-07 04:19:15 +0000 |
commit | 26bd1cb9d24b186c5361e59d4c448bfa93ef740f (patch) | |
tree | 8d6a4bf3e62b4e246db1f140c0c2e66e23846568 /src/qml/qml | |
parent | 6c75a6589f45d60c27ca52ba951266632e0c1cae (diff) |
wasm: cleanup code, remove obsolete code
Change-Id: I54f406d803fa6d458ae53a78abb8c99dc76aab92
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/ftw/qqmlthread.cpp | 3 | ||||
-rw-r--r-- | src/qml/qml/qqmlimport.cpp | 1 | ||||
-rw-r--r-- | src/qml/qml/qqmltypeloader.cpp | 3 |
3 files changed, 6 insertions, 1 deletions
diff --git a/src/qml/qml/ftw/qqmlthread.cpp b/src/qml/qml/ftw/qqmlthread.cpp index cffa1b64b0..c0d104fb1f 100644 --- a/src/qml/qml/ftw/qqmlthread.cpp +++ b/src/qml/qml/ftw/qqmlthread.cpp @@ -322,7 +322,6 @@ void QQmlThread::internalCallMethodInThread(Message *message) bool wasEmpty = d->threadList.isEmpty(); d->threadList.append(message); - if (wasEmpty && d->m_threadProcessing == false) d->triggerThreadEvent(); @@ -404,7 +403,9 @@ void QQmlThread::waitForNextMessage() Q_ASSERT(!isThisThread()); d->lock(); Q_ASSERT(d->m_mainThreadWaiting == false); + d->m_mainThreadWaiting = true; + if (d->mainSync || !d->threadList.isEmpty()) { if (d->mainSync) { QQmlThread::Message *message = d->mainSync; diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index fe7e5d5a33..bfbfd2e76a 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -1280,6 +1280,7 @@ bool QQmlImportsPrivate::locateQmldir(const QString &uri, int vmaj, int vmin, QQ QQmlAbstractUrlInterceptor *interceptor = typeLoader.engine()->urlInterceptor(); QStringList localImportPaths = database->importPathList( interceptor ? QQmlImportDatabase::LocalOrRemote : QQmlImportDatabase::Local); + // Search local import paths for a matching version const QStringList qmlDirPaths = QQmlImports::completeQmldirPaths(uri, localImportPaths, vmaj, vmin); for (QString qmldirPath : qmlDirPaths) { diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index f4c612b187..1936030666 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -1044,6 +1044,8 @@ void QQmlTypeLoader::doLoad(const Loader &loader, QQmlDataBlob *blob, Mode mode) qWarning("QQmlTypeLoader::doLoad(%s): %s thread", qPrintable(blob->urlString()), m_thread->isThisThread()?"Compile":"Engine"); #endif + blob->startLoading(); + if (m_thread->isThisThread()) { unlock(); loader.loadThread(this, blob); @@ -1692,6 +1694,7 @@ QQmlTypeData *QQmlTypeLoader::getType(const QUrl &unNormalizedUrl, Mode mode) } else if ((mode == PreferSynchronous || mode == Synchronous) && QQmlFile::isSynchronous(url)) { // this was started Asynchronous, but we need to force Synchronous // completion now (if at all possible with this type of URL). + if (!m_thread->isThisThread()) { // this only works when called directly from the UI thread, but not // when recursively called on the QML thread via resolveTypes() |