diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-05-24 19:56:58 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-05-26 02:47:41 +0200 |
commit | 82be884e2f8fe38c23476cd7e03a410225dfd42f (patch) | |
tree | 9bf4525a6f54a86dca565d3999632fa8ccd74e5f /src | |
parent | 805aa4df3544591afd8c822a51abd142f9008f01 (diff) |
Small cleanup
We don't do rewriting for bindings anymore.
Remove a method overload that's not really needed
anymore.
Change-Id: I9d57d30dce4848cb06c88c3f042ccf30e6d41aab
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmlbinding.cpp | 7 | ||||
-rw-r--r-- | src/qml/qml/qqmljavascriptexpression.cpp | 9 | ||||
-rw-r--r-- | src/qml/qml/qqmljavascriptexpression_p.h | 4 | ||||
-rw-r--r-- | src/qml/qml/qqmlvmemetaobject.cpp | 6 |
4 files changed, 3 insertions, 23 deletions
diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index 32b20149e8..79b1b2efc5 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -121,7 +121,6 @@ QQmlBinding::QQmlBinding(const QQmlScriptString &script, QObject *obj, QQmlConte if (!ctxt && (!scriptPrivate->context || !scriptPrivate->context->isValid())) return; - bool needRewrite = true; QString code; int id = scriptPrivate->bindingId; @@ -133,7 +132,6 @@ QQmlBinding::QQmlBinding(const QQmlScriptString &script, QObject *obj, QQmlConte Q_ASSERT(typeData); if (QQmlCompiledData *cdata = typeData->compiledData()) { - needRewrite = true; code = cdata->primitives.at(id); m_url = cdata->name; } @@ -150,10 +148,7 @@ QQmlBinding::QQmlBinding(const QQmlScriptString &script, QObject *obj, QQmlConte m_lineNumber = scriptPrivate->lineNumber; m_columnNumber = scriptPrivate->columnNumber; - if (needRewrite) - v4function = qmlBinding(context(), scopeObject(), code, QString(), m_lineNumber); - else - v4function = evalFunction(context(), scopeObject(), code, QString(), m_lineNumber); + v4function = qmlBinding(context(), scopeObject(), code, QString(), m_lineNumber); } QQmlBinding::QQmlBinding(const QString &str, QObject *obj, QQmlContextData *ctxt) diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index 28abf5fa11..99ab12fcb5 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -308,15 +308,6 @@ void QQmlJavaScriptExpression::exceptionToError(const QV4::Exception &e, QQmlErr QV4::PersistentValue QQmlJavaScriptExpression::evalFunction(QQmlContextData *ctxt, QObject *scope, - const char *code, int codeLength, - const QString &filename, quint16 line, - QV4::PersistentValue *qmlscope) -{ - return evalFunction(ctxt, scope, QString::fromUtf8(code, codeLength), filename, line, qmlscope); -} - -QV4::PersistentValue -QQmlJavaScriptExpression::evalFunction(QQmlContextData *ctxt, QObject *scope, const QString &code, const QString &filename, quint16 line, QV4::PersistentValue *qmlscope) { diff --git a/src/qml/qml/qqmljavascriptexpression_p.h b/src/qml/qml/qqmljavascriptexpression_p.h index caf1266415..0b93087f97 100644 --- a/src/qml/qml/qqmljavascriptexpression_p.h +++ b/src/qml/qml/qqmljavascriptexpression_p.h @@ -151,10 +151,6 @@ public: const QString &code, const QString &filename, quint16 line, QV4::PersistentValue *qmlscope = 0); - static QV4::PersistentValue evalFunction(QQmlContextData *ctxt, QObject *scope, - const char *code, int codeLength, - const QString &filename, quint16 line, - QV4::PersistentValue *qmlscope = 0); // doesn't require rewriting the expression static QV4::PersistentValue qmlBinding(QQmlContextData *ctxt, QObject *scope, const QString &code, diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp index cec50ddd5b..ace9ff9a65 100644 --- a/src/qml/qml/qqmlvmemetaobject.cpp +++ b/src/qml/qml/qqmlvmemetaobject.cpp @@ -976,10 +976,8 @@ QV4::Value QQmlVMEMetaObject::method(int index) // XXX We should evaluate all methods in a single big script block to // improve the call time between dynamic methods defined on the same // object - v8methods[index] = QQmlExpressionPrivate::evalFunction(ctxt, object, body, - bodyLength, - ctxt->urlString, - data->lineNumber); + v8methods[index] = QQmlExpressionPrivate::evalFunction(ctxt, object, QString::fromUtf8(body, bodyLength), + ctxt->urlString, data->lineNumber); } return v8methods[index]; |