diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-12-04 09:15:13 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-12-04 09:15:13 (GMT) |
commit | f3a55136c0375d358e93929e94c2ab6c15dbfb93 (patch) | |
tree | da684dbcf6df7fad4d0badbda42eec5053dbc3c7 /src/declarative/qml/qmlworkerscript.cpp | |
parent | 23708b0676ed4db10aca81eb2eb1e043fef21328 (diff) | |
download | Qt-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.cpp | 5 |
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(); |