summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlworkerscript.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-12-04 09:15:13 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-12-04 09:15:13 (GMT)
commitf3a55136c0375d358e93929e94c2ab6c15dbfb93 (patch)
treeda684dbcf6df7fad4d0badbda42eec5053dbc3c7 /src/declarative/qml/qmlworkerscript.cpp
parent23708b0676ed4db10aca81eb2eb1e043fef21328 (diff)
downloadQt-f3a55136c0375d358e93929e94c2ab6c15dbfb93.zip
Qt-f3a55136c0375d358e93929e94c2ab6c15dbfb93.tar.gz
Qt-f3a55136c0375d358e93929e94c2ab6c15dbfb93.tar.bz2
Make QmlScriptEngine reusable in WorkScript, so extra fns are available.
Add Qt.resolvedUrl(url)
Diffstat (limited to 'src/declarative/qml/qmlworkerscript.cpp')
-rw-r--r--src/declarative/qml/qmlworkerscript.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlworkerscript.cpp b/src/declarative/qml/qmlworkerscript.cpp
index 2a3dbce..45bb535 100644
--- a/src/declarative/qml/qmlworkerscript.cpp
+++ b/src/declarative/qml/qmlworkerscript.cpp
@@ -101,9 +101,9 @@ class QmlWorkerScriptEnginePrivate : public QObject
public:
QmlWorkerScriptEnginePrivate();
- struct ScriptEngine : public QScriptEngine
+ struct ScriptEngine : public QmlScriptEngine
{
- ScriptEngine(QmlWorkerScriptEnginePrivate *parent) : p(parent) {}
+ ScriptEngine(QmlWorkerScriptEnginePrivate *parent) : QmlScriptEngine(0), p(parent) {}
QmlWorkerScriptEnginePrivate *p;
};
ScriptEngine *workerEngine;
@@ -259,6 +259,7 @@ void QmlWorkerScriptEnginePrivate::processLoad(int id, const QUrl &url)
QScriptContext *ctxt = workerEngine->pushContext();
ctxt->setActivationObject(activation);
+ workerEngine->baseUrl = url;
workerEngine->evaluate(script);
workerEngine->popContext();