From 497ccdc843975bfe20f5b24e083d17f01012efb9 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 10 Apr 2015 12:34:36 +0200 Subject: Speed up binding evaluation Don't spend any cycles of determining the location of the binding (file, line, column) unless we really need that information. That's the case when the profiler is active or an error happens. Change-Id: Iae97808d500b88fed6a813e8b224aa6ebe04d3b6 Reviewed-by: Lars Knoll --- src/qml/qml/qqmljavascriptexpression.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/qml/qml/qqmljavascriptexpression.cpp') diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index 3ac0f23e4d..02bd1c4b83 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -40,6 +40,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -59,11 +60,11 @@ bool QQmlDelayedError::addError(QQmlEnginePrivate *e) return true; } -void QQmlDelayedError::setErrorLocation(const QUrl &url, quint16 line, quint16 column) +void QQmlDelayedError::setErrorLocation(const QQmlSourceLocation &sourceLocation) { - m_error.setUrl(url); - m_error.setLine(line); - m_error.setColumn(column); + m_error.setUrl(QUrl(sourceLocation.sourceFile)); + m_error.setLine(sourceLocation.line); + m_error.setColumn(sourceLocation.column); } void QQmlDelayedError::setErrorDescription(const QString &description) -- cgit v1.2.3