summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlcontext.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-11-29 10:46:00 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-11-29 10:46:00 (GMT)
commitd406a899943c6d56d921bc290a009415a3c4eba5 (patch)
treec48f12180910251b4572cb3600a72332ff5f34f5 /src/declarative/qml/qmlcontext.cpp
parent696b55195f1ad40a077683dbc533c73baf1536ee (diff)
downloadQt-d406a899943c6d56d921bc290a009415a3c4eba5.zip
Qt-d406a899943c6d56d921bc290a009415a3c4eba5.tar.gz
Qt-d406a899943c6d56d921bc290a009415a3c4eba5.tar.bz2
Support array-literal Script::source values
Diffstat (limited to 'src/declarative/qml/qmlcontext.cpp')
-rw-r--r--src/declarative/qml/qmlcontext.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp
index 42f467b..38cbcfa 100644
--- a/src/declarative/qml/qmlcontext.cpp
+++ b/src/declarative/qml/qmlcontext.cpp
@@ -59,8 +59,7 @@ QmlContextPrivate::QmlContextPrivate()
{
}
-void QmlContextPrivate::addScript(const QString &script, QObject *scopeObject,
- const QString &fileName, int lineNumber)
+void QmlContextPrivate::addScript(const QmlParser::Object::ScriptBlock &script, QObject *scopeObject)
{
Q_Q(QmlContext);
@@ -76,12 +75,14 @@ void QmlContextPrivate::addScript(const QString &script, QObject *scopeObject,
QScriptValue scope = scriptEngine->newObject();
scriptContext->setActivationObject(scope);
- QScriptValue val = scriptEngine->evaluate(script, fileName, lineNumber);
+ for (int ii = 0; ii < script.codes.count(); ++ii) {
+ scriptEngine->evaluate(script.codes.at(ii), script.files.at(ii), script.lineNumbers.at(ii));
- if (scriptEngine->hasUncaughtException()) {
- QmlError error;
- QmlExpressionPrivate::exceptionToError(scriptEngine, error);
- qWarning().nospace() << qPrintable(error.toString());
+ if (scriptEngine->hasUncaughtException()) {
+ QmlError error;
+ QmlExpressionPrivate::exceptionToError(scriptEngine, error);
+ qWarning().nospace() << qPrintable(error.toString());
+ }
}
scriptEngine->popContext();