diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2016-08-12 16:57:29 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-08-18 08:27:46 +0000 |
commit | 31650bc49b64c8ee6e14094a4d869afe08c5c25d (patch) | |
tree | f17a161d92c53a8f0a3b4e2b9eae29e4320c5fe7 /src | |
parent | 707b9be53cef30ea9b7029945ef70e3d769b4e78 (diff) |
Minor binding code cleanup
Remove the QQmlBinding *binding argument as it is always the this
pointer.
Change-Id: I76ccf64a1d37ce32089c81f60466dce79b9fa5bf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmlbinding.cpp | 11 | ||||
-rw-r--r-- | src/qml/qml/qqmlbinding_p.h | 2 |
2 files changed, 7 insertions, 6 deletions
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; |