From 31650bc49b64c8ee6e14094a4d869afe08c5c25d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 12 Aug 2016 16:57:29 +0200 Subject: Minor binding code cleanup Remove the QQmlBinding *binding argument as it is always the this pointer. Change-Id: I76ccf64a1d37ce32089c81f60466dce79b9fa5bf Reviewed-by: Lars Knoll --- src/qml/qml/qqmlbinding.cpp | 11 ++++++----- src/qml/qml/qqmlbinding_p.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/qml/qml') diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp index 8ed7641610..d944857fc1 100644 --- a/src/qml/qml/qqmlbinding.cpp +++ b/src/qml/qml/qqmlbinding.cpp @@ -191,7 +191,7 @@ void QQmlBinding::update(QQmlPropertyData::WriteFlags flags) flags.setFlag(QQmlPropertyData::BypassInterceptor); QQmlBindingProfiler prof(ep->profiler, this, f); - doUpdate(this, watcher, flags, scope, f); + doUpdate(watcher, flags, scope, f); if (!watcher.wasDeleted()) setUpdatingFlag(false); @@ -205,14 +205,15 @@ void QQmlBinding::update(QQmlPropertyData::WriteFlags flags) class QQmlBindingBinding: public QQmlBinding { protected: - void doUpdate(QQmlBinding *binding, const DeleteWatcher &, + void doUpdate(const DeleteWatcher &, QQmlPropertyData::WriteFlags flags, QV4::Scope &, const QV4::ScopedFunctionObject &) Q_DECL_OVERRIDE Q_DECL_FINAL { Q_ASSERT(!m_targetIndex.hasValueTypeIndex()); QQmlPropertyData *pd = nullptr; getPropertyData(&pd, nullptr); - pd->writeProperty(*m_target, &binding, flags); + QQmlBinding *thisPtr = this; + pd->writeProperty(*m_target, &thisPtr, flags); } }; @@ -221,7 +222,7 @@ protected: class QQmlNonbindingBinding: public QQmlBinding { protected: - void doUpdate(QQmlBinding *binding, const DeleteWatcher &watcher, + void doUpdate(const DeleteWatcher &watcher, QQmlPropertyData::WriteFlags flags, QV4::Scope &scope, const QV4::ScopedFunctionObject &f) Q_DECL_OVERRIDE Q_DECL_FINAL { @@ -231,7 +232,7 @@ protected: bool isUndefined = false; QV4::ScopedCallData callData(scope); - binding->QQmlJavaScriptExpression::evaluate(callData, &isUndefined, scope); + QQmlJavaScriptExpression::evaluate(callData, &isUndefined, scope); bool error = false; if (!watcher.wasDeleted() && isAddedToObject() && !hasError()) diff --git a/src/qml/qml/qqmlbinding_p.h b/src/qml/qml/qqmlbinding_p.h index 1801c3040c..6d42a8ea8a 100644 --- a/src/qml/qml/qqmlbinding_p.h +++ b/src/qml/qml/qqmlbinding_p.h @@ -102,7 +102,7 @@ public: void expressionChanged() Q_DECL_OVERRIDE; protected: - virtual void doUpdate(QQmlBinding *binding, const DeleteWatcher &watcher, + virtual void doUpdate(const DeleteWatcher &watcher, QQmlPropertyData::WriteFlags flags, QV4::Scope &scope, const QV4::ScopedFunctionObject &f) = 0; -- cgit v1.2.3