aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlworkerscript
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmlworkerscript')
-rw-r--r--src/qmlworkerscript/dependencies.json2
-rw-r--r--src/qmlworkerscript/qquickworkerscript.cpp4
-rw-r--r--src/qmlworkerscript/qquickworkerscript_p.h4
3 files changed, 8 insertions, 2 deletions
diff --git a/src/qmlworkerscript/dependencies.json b/src/qmlworkerscript/dependencies.json
new file mode 100644
index 0000000000..0d4f101c7a
--- /dev/null
+++ b/src/qmlworkerscript/dependencies.json
@@ -0,0 +1,2 @@
+[
+]
diff --git a/src/qmlworkerscript/qquickworkerscript.cpp b/src/qmlworkerscript/qquickworkerscript.cpp
index 4a79027234..0bdbbabadc 100644
--- a/src/qmlworkerscript/qquickworkerscript.cpp
+++ b/src/qmlworkerscript/qquickworkerscript.cpp
@@ -130,7 +130,9 @@ struct WorkerScript : public QV4::ExecutionEngine {
QQuickWorkerScriptEnginePrivate *p = nullptr;
QUrl source;
QQuickWorkerScript *owner = nullptr;
+#if QT_CONFIG(qml_network)
QScopedPointer<QNetworkAccessManager> scriptLocalNAM;
+#endif
int id = -1;
};
@@ -390,6 +392,7 @@ WorkerScript::WorkerScript(int id, QQuickWorkerScriptEnginePrivate *parent)
QV4::ScopedValue sendMessage(scope, QV4::FunctionObject::createBuiltinFunction(this, name, QQuickWorkerScriptEnginePrivate::method_sendMessage, 1));
api->put(QV4::ScopedString(scope, scope.engine->newString(QStringLiteral("sendMessage"))), sendMessage);
globalObject->put(QV4::ScopedString(scope, scope.engine->newString(QStringLiteral("WorkerScript"))), api);
+#if QT_CONFIG(qml_network)
networkAccessManager = [](QV4::ExecutionEngine *engine){
auto *workerScript = static_cast<WorkerScript *>(engine);
if (workerScript->scriptLocalNAM)
@@ -400,6 +403,7 @@ WorkerScript::WorkerScript(int id, QQuickWorkerScriptEnginePrivate *parent)
workerScript->scriptLocalNAM.reset(new QNetworkAccessManager(workerScript->p));
return workerScript->scriptLocalNAM.get();
};
+#endif // qml_network
}
int QQuickWorkerScriptEngine::registerWorkerScript(QQuickWorkerScript *owner)
diff --git a/src/qmlworkerscript/qquickworkerscript_p.h b/src/qmlworkerscript/qquickworkerscript_p.h
index 50eb8353b4..d1ea34422a 100644
--- a/src/qmlworkerscript/qquickworkerscript_p.h
+++ b/src/qmlworkerscript/qquickworkerscript_p.h
@@ -88,7 +88,7 @@ class Q_AUTOTEST_EXPORT QQuickWorkerScript : public QObject, public QQmlParserSt
{
Q_OBJECT
Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
- Q_PROPERTY(bool ready READ ready NOTIFY readyChanged)
+ Q_PROPERTY(bool ready READ ready NOTIFY readyChanged REVISION(2, 15))
QML_NAMED_ELEMENT(WorkerScript);
QML_ADDED_IN_VERSION(2, 0)
@@ -108,7 +108,7 @@ public Q_SLOTS:
Q_SIGNALS:
void sourceChanged();
- void readyChanged();
+ Q_REVISION(2, 15) void readyChanged();
void message(const QJSValue &messageObject);
protected: