diff options
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/animations/qabstractanimationjob.cpp | 3 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4executableallocator_p.h | 5 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4vme_moth.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/ftw/qqmlthread.cpp | 19 | ||||
-rw-r--r-- | src/qml/qml/qqmlimport.cpp | 11 | ||||
-rw-r--r-- | src/qml/qml/qqmltypeloader.cpp | 29 | ||||
-rw-r--r-- | src/qml/qml/v8/qv8engine.cpp | 2 | ||||
-rw-r--r-- | src/qml/qtqmlglobal.h | 2 | ||||
-rw-r--r-- | src/qml/util/qqmlchangeset.cpp | 2 |
9 files changed, 60 insertions, 15 deletions
diff --git a/src/qml/animations/qabstractanimationjob.cpp b/src/qml/animations/qabstractanimationjob.cpp index 3f33e7e81b..2bb5766c7b 100644 --- a/src/qml/animations/qabstractanimationjob.cpp +++ b/src/qml/animations/qabstractanimationjob.cpp @@ -78,7 +78,8 @@ QQmlAnimationTimer *QQmlAnimationTimer::instance(bool create) inst = animationTimer() ? animationTimer()->localData() : 0; } #else - static QAnimationTimer unifiedTimer; + Q_UNUSED(create) + static QQmlAnimationTimer unifiedTimer; inst = &unifiedTimer; #endif return inst; diff --git a/src/qml/jsruntime/qv4executableallocator_p.h b/src/qml/jsruntime/qv4executableallocator_p.h index 375c9a365f..19eaed8723 100644 --- a/src/qml/jsruntime/qv4executableallocator_p.h +++ b/src/qml/jsruntime/qv4executableallocator_p.h @@ -100,9 +100,14 @@ public: bool mergeNext(ExecutableAllocator *allocator); bool mergePrevious(ExecutableAllocator *allocator); +#ifndef QT_NO_BITFIELDS quintptr addr = 0; uint size : 31; // More than 2GB of function code? nah :) uint free : 1; +#else + uint size = 31; // More than 2GB of function code? nah :) + uint free = 1; +#endif Allocation *next = nullptr; Allocation *prev = nullptr; }; diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index e73365e9b1..6adb25f964 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -995,7 +995,7 @@ QV4::ReturnedValue VME::exec(const FunctionObject *fo, const Value *thisObject, MOTH_BEGIN_INSTR(Construct) STORE_IP(); - acc = Runtime::method_construct(engine, STACK_VALUE(func), stack + argv, argc); + acc = Runtime::method_construct(engine, STACK_VALUE(func), stack + argv, argc); CHECK_EXCEPTION; MOTH_END_INSTR(Construct) diff --git a/src/qml/qml/ftw/qqmlthread.cpp b/src/qml/qml/ftw/qqmlthread.cpp index 96313d7627..9c44e18b87 100644 --- a/src/qml/qml/ftw/qqmlthread.cpp +++ b/src/qml/qml/ftw/qqmlthread.cpp @@ -106,6 +106,9 @@ void QQmlThreadPrivate::triggerMainEvent() { Q_ASSERT(q->isThisThread()); QCoreApplication::postEvent(&m_mainObject, new QEvent(QEvent::User)); +#ifdef Q_OS_HTML5 + QCoreApplication::processEvents(); +#endif } // Trigger even in thread. Must be called from main thread. @@ -113,6 +116,9 @@ void QQmlThreadPrivate::triggerThreadEvent() { Q_ASSERT(!q->isThisThread()); QCoreApplication::postEvent(this, new QEvent(QEvent::User)); +#ifdef Q_OS_HTML5 + QCoreApplication::processEvents(); +#endif } bool QQmlThreadPrivate::MainObject::event(QEvent *e) @@ -322,11 +328,16 @@ void QQmlThread::internalCallMethodInThread(Message *message) bool wasEmpty = d->threadList.isEmpty(); d->threadList.append(message); + +#ifdef QT_NO_THREAD + d->mainSync = message; +#endif if (wasEmpty && d->m_threadProcessing == false) d->triggerThreadEvent(); - d->m_mainThreadWaiting = true; +#ifndef QT_NO_THREAD + d->m_mainThreadWaiting = true; do { if (d->mainSync) { QQmlThread::Message *message = d->mainSync; @@ -340,7 +351,7 @@ void QQmlThread::internalCallMethodInThread(Message *message) d->wait(); } } while (d->mainSync || !d->threadList.isEmpty()); - +#endif d->m_mainThreadWaiting = false; d->unlock(); } @@ -402,8 +413,10 @@ void QQmlThread::waitForNextMessage() d->lock(); Q_ASSERT(d->m_mainThreadWaiting == false); +#ifdef QT_NO_THREAD + d->triggerThreadEvent(); +#endif 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 005db4248e..fe7e5d5a33 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -1280,7 +1280,6 @@ 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) { @@ -1756,10 +1755,16 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e) { filePluginPath << QLatin1String("."); // Search order is applicationDirPath(), qrc:/qt-project.org/imports, $QML2_IMPORT_PATH, QLibraryInfo::Qml2ImportsPath +#ifdef Q_OS_HTML5 + // Hardcode the qml imports to "qml/" relative to the app nexe. + // This should perhaps be set via Qml2Imports in qt.conf. + QString installImportsPath = QStringLiteral("qml/"); - QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath); - addImportPath(installImportsPath); +#else + QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath); +#endif + addImportPath(installImportsPath); // env import paths if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QML2_IMPORT_PATH"))) { const QString envImportPath = qEnvironmentVariable("QML2_IMPORT_PATH"); diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index 5572fdad44..ed742c3681 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -495,8 +495,9 @@ The setError() method may only be called from within a QQmlDataBlob callback. */ void QQmlDataBlob::addDependency(QQmlDataBlob *blob) { +#ifndef Q_OS_HTML5 ASSERT_CALLBACK(); - +#endif Q_ASSERT(status() != Null); if (!blob || @@ -1004,7 +1005,12 @@ struct StaticLoader { void loadThread(QQmlTypeLoader *loader, QQmlDataBlob *blob) const { +#ifdef QT_NO_THREAD + loader->m_thread->loadWithStaticDataAsync(blob, data); + return; +#else loader->loadWithStaticDataThread(blob, data); +#endif } void load(QQmlTypeLoader *loader, QQmlDataBlob *blob) const { @@ -1041,8 +1047,9 @@ 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(); - +#ifdef QT_NO_THREAD + mode = Asynchronous; +#endif if (m_thread->isThisThread()) { unlock(); loader.loadThread(this, blob); @@ -1681,7 +1688,7 @@ QQmlTypeData *QQmlTypeLoader::getType(const QUrl &url, 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). - +#ifndef QT_NO_THREAD 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() @@ -1692,6 +1699,7 @@ QQmlTypeData *QQmlTypeLoader::getType(const QUrl &url, Mode mode) lock(); } } +#endif } typeData->addref(); @@ -1705,6 +1713,9 @@ QQmlTypeData will not be cached. */ QQmlTypeData *QQmlTypeLoader::getType(const QByteArray &data, const QUrl &url, Mode mode) { +#ifdef QT_NO_THREAD + mode = Asynchronous; +#endif LockHolder<QQmlTypeLoader> holder(this); QQmlTypeData *typeData = new QQmlTypeData(url, this); @@ -1749,10 +1760,14 @@ Returns a QQmlQmldirData for \a url. The QQmlQmldirData may be cached. */ QQmlQmldirData *QQmlTypeLoader::getQmldir(const QUrl &url) { +#ifdef Q_OS_HTML5 + // ### asserts here on urls like "qml/QtQuick.2.1/qmldir", + // which are relative urls we want to load over the network. +#else Q_ASSERT(!url.isRelative() && (QQmlFile::urlToLocalFileOrQrc(url).isEmpty() || !QDir::isRelativePath(QQmlFile::urlToLocalFileOrQrc(url)))); - +#endif LockHolder<QQmlTypeLoader> holder(this); QQmlQmldirData *qmldirData = m_qmldirCache.value(url); @@ -2426,10 +2441,10 @@ bool QQmlTypeData::loadImplicitImport() void QQmlTypeData::dataReceived(const SourceCodeData &data) { m_backupSourceCode = data; - +#ifndef Q_OS_HTML5 if (tryLoadFromDiskCache()) return; - +#endif if (isError()) return; diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp index 038a75d50a..bdb066267a 100644 --- a/src/qml/qml/v8/qv8engine.cpp +++ b/src/qml/qml/v8/qv8engine.cpp @@ -129,11 +129,13 @@ QV8Engine::QV8Engine(QJSEngine *qq, QV4::ExecutionEngine *v4) , m_v4Engine(v4) , m_xmlHttpRequestData(nullptr) { +#ifndef Q_OS_HTML5 #ifdef Q_PROCESSOR_X86_32 if (!qCpuHasFeature(SSE2)) { qFatal("This program requires an X86 processor that supports SSE2 extension, at least a Pentium 4 or newer"); } #endif +#endif QML_MEMORY_SCOPE_STRING("QV8Engine::QV8Engine"); qMetaTypeId<QJSValue>(); diff --git a/src/qml/qtqmlglobal.h b/src/qml/qtqmlglobal.h index 6e92867cf5..f22eb54c43 100644 --- a/src/qml/qtqmlglobal.h +++ b/src/qml/qtqmlglobal.h @@ -51,7 +51,9 @@ # include <QtNetwork/qtnetworkglobal.h> # endif #else +//#ifndef QT_FEATURE_qml_debug # define QT_FEATURE_qml_debug -1 +//#endif #endif QT_BEGIN_NAMESPACE diff --git a/src/qml/util/qqmlchangeset.cpp b/src/qml/util/qqmlchangeset.cpp index ba876b42e2..561bde7d0c 100644 --- a/src/qml/util/qqmlchangeset.cpp +++ b/src/qml/util/qqmlchangeset.cpp @@ -68,6 +68,7 @@ QT_BEGIN_NAMESPACE QQmlChangeSet::QQmlChangeSet() : m_difference(0) { + qRegisterMetaType<QQmlChangeSet >("QQmlChangeSet"); } /*! @@ -80,6 +81,7 @@ QQmlChangeSet::QQmlChangeSet(const QQmlChangeSet &changeSet) , m_changes(changeSet.m_changes) , m_difference(changeSet.m_difference) { + qRegisterMetaType<QQmlChangeSet >("QQmlChangeSet"); } /*! |