summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativeworkerscript.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-05-14 07:15:08 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-05-14 07:15:08 (GMT)
commitd9ab23c190de774ea093652060981e14ac5aeaf8 (patch)
tree80a4926c2ecfd4b9284fe64e23e6d0a6ab646678 /src/declarative/qml/qdeclarativeworkerscript.cpp
parent2f6eb60bf4012f9a185d7cd5d4c50762c3abc7f7 (diff)
downloadQt-d9ab23c190de774ea093652060981e14ac5aeaf8.zip
Qt-d9ab23c190de774ea093652060981e14ac5aeaf8.tar.gz
Qt-d9ab23c190de774ea093652060981e14ac5aeaf8.tar.bz2
Qt.include() support in worker scripts
Diffstat (limited to 'src/declarative/qml/qdeclarativeworkerscript.cpp')
-rw-r--r--src/declarative/qml/qdeclarativeworkerscript.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativeworkerscript.cpp b/src/declarative/qml/qdeclarativeworkerscript.cpp
index c55998f..4b687a9 100644
--- a/src/declarative/qml/qdeclarativeworkerscript.cpp
+++ b/src/declarative/qml/qdeclarativeworkerscript.cpp
@@ -289,7 +289,11 @@ void QDeclarativeWorkerScriptEnginePrivate::processLoad(int id, const QUrl &url)
QScriptValue activation = getWorker(id);
- QScriptContext *ctxt = workerEngine->pushContext();
+ QScriptContext *ctxt = QScriptDeclarativeClass::pushCleanContext(workerEngine);
+ QScriptValue urlContext = workerEngine->newObject();
+ urlContext.setData(QScriptValue(workerEngine, fileName));
+ ctxt->pushScope(urlContext);
+ ctxt->pushScope(activation);
ctxt->setActivationObject(activation);
workerEngine->baseUrl = url;