diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-07-27 03:48:14 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-07-27 03:48:14 (GMT) |
commit | 307fad7e813770c8f2a6236828b26cd14ddc57aa (patch) | |
tree | 98096d4fbe7dea9b81dfd71ae5b52736dbd40219 | |
parent | 80476372e6f4dd3e179eeba949e86a336bc8fde3 (diff) | |
download | Qt-307fad7e813770c8f2a6236828b26cd14ddc57aa.zip Qt-307fad7e813770c8f2a6236828b26cd14ddc57aa.tar.gz Qt-307fad7e813770c8f2a6236828b26cd14ddc57aa.tar.bz2 |
Make sure we pass through a line number for evaluating bindings.
Also, don't convert URL to string each time we call evaluate.
-rw-r--r-- | src/declarative/qml/qmlcompiler.cpp | 1 | ||||
-rw-r--r-- | src/declarative/qml/qmlexpression.cpp | 4 | ||||
-rw-r--r-- | src/declarative/qml/qmlexpression_p.h | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index f0473f5..9c9a7bd 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -2088,6 +2088,7 @@ void QmlCompiler::genBindingAssignment(QmlParser::Value *binding, store.assignBinding.value = dataRef; store.assignBinding.context = ref.bindingContext.stack; store.assignBinding.owner = ref.bindingContext.owner; + store.line = prop->location.end.line; output->bytecode << store; } diff --git a/src/declarative/qml/qmlexpression.cpp b/src/declarative/qml/qmlexpression.cpp index ea0e9aa..e88766c 100644 --- a/src/declarative/qml/qmlexpression.cpp +++ b/src/declarative/qml/qmlexpression.cpp @@ -257,7 +257,7 @@ QVariant QmlExpressionPrivate::evalQtScript() QmlRewrite::RewriteBinding rewriteBinding; const QString code = rewriteBinding(expression); - expressionFunction = scriptEngine->evaluate(code, fileName.toString(), line); + expressionFunction = scriptEngine->evaluate(code, fileName, line); expressionFunctionValid = true; } @@ -421,7 +421,7 @@ void QmlExpression::setTrackChange(bool trackChange) void QmlExpression::setSourceLocation(const QUrl &fileName, int line) { Q_D(QmlExpression); - d->fileName = fileName; + d->fileName = fileName.toString(); d->line = line; } diff --git a/src/declarative/qml/qmlexpression_p.h b/src/declarative/qml/qmlexpression_p.h index 41b7749..a20ead4 100644 --- a/src/declarative/qml/qmlexpression_p.h +++ b/src/declarative/qml/qmlexpression_p.h @@ -83,7 +83,7 @@ public: QObject *me; bool trackChange; - QUrl fileName; + QString fileName; int line; quint32 id; |