diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-02-24 09:41:22 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-02-24 10:27:26 +0100 |
commit | deb74c609e066b0efd73d1adbc6077e6ca7d8c45 (patch) | |
tree | a48897b135705f6daad22eed982642b8c1247185 /src/qmlworkerscript | |
parent | dd481a2bb4f858178b984a38cd8c3621d46446b7 (diff) |
Fix build with -no-feature-network
Fixes: QTBUG-82418
Change-Id: Ibceeefed75941d963e6b79b44e9231d0d8053221
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qmlworkerscript')
-rw-r--r-- | src/qmlworkerscript/qquickworkerscript.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qmlworkerscript/qquickworkerscript.cpp b/src/qmlworkerscript/qquickworkerscript.cpp index d42742d6f5..635d508daf 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) |