From 7127bf1d044e8e0ceb24347be98c7c504c501107 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 21 Aug 2020 12:16:40 +0200 Subject: [PATCH] Rename QSequentialIterable::ref Follow the naming convention and remove workarounds in ctors. Change-Id: Ic7f9de074edab7db369803612a2a2a4ea3deaf57 Reviewed-by: Fabian Kosmale Reviewed-by: Lars Knoll --- src/corelib/kernel/qvariant.cpp | 28 ++++++++++++++-------------- src/corelib/kernel/qvariant.h | 6 +++--- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index f4f1015231..1bc676a36c 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -2579,16 +2579,16 @@ QSequentialIterable::QSequentialIterable(const QtMetaTypePrivate::QSequentialIte { } -QSequentialIterable::const_iterator::const_iterator(const QSequentialIterable &iter, QAtomicInt *ref_) - : m_impl(iter.m_impl), ref(ref_) +QSequentialIterable::const_iterator::const_iterator(const QSequentialIterable &iter, QAtomicInt *ref) + : m_impl(iter.m_impl), m_ref(ref) { - ref->ref(); + m_ref->ref(); } -QSequentialIterable::const_iterator::const_iterator(const QtMetaTypePrivate::QSequentialIterableImpl &impl, QAtomicInt *ref_) - : m_impl(impl), ref(ref_) +QSequentialIterable::const_iterator::const_iterator(const QtMetaTypePrivate::QSequentialIterableImpl &impl, QAtomicInt *ref) + : m_impl(impl), m_ref(ref) { - ref->ref(); + m_ref->ref(); } /*! \fn QSequentialIterable::const_iterator QSequentialIterable::begin() const @@ -2670,9 +2670,9 @@ bool QSequentialIterable::canReverseIterate() const Destroys the QSequentialIterable::const_iterator. */ QSequentialIterable::const_iterator::~const_iterator() { - if (!ref->deref()) { + if (!m_ref->deref()) { m_impl.destroyIter(); - delete ref; + delete m_ref; } } @@ -2680,9 +2680,9 @@ QSequentialIterable::const_iterator::~const_iterator() { Creates a copy of \a other. */ QSequentialIterable::const_iterator::const_iterator(const const_iterator &other) - : m_impl(other.m_impl), ref(other.ref) + : m_impl(other.m_impl), m_ref(other.m_ref) { - ref->ref(); + m_ref->ref(); } /*! @@ -2691,13 +2691,13 @@ QSequentialIterable::const_iterator::const_iterator(const const_iterator &other) QSequentialIterable::const_iterator& QSequentialIterable::const_iterator::operator=(const const_iterator &other) { - other.ref->ref(); - if (!ref->deref()) { + other.m_ref->ref(); + if (!m_ref->deref()) { m_impl.destroyIter(); - delete ref; + delete m_ref; } m_impl = other.m_impl; - ref = other.ref; + m_ref = other.m_ref; return *this; } diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index 0854711e1a..997b7ddd4a 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -587,11 +587,11 @@ public: { private: QtMetaTypePrivate::QSequentialIterableImpl m_impl; - QAtomicInt *ref; + QAtomicInt *m_ref; friend class QSequentialIterable; - explicit const_iterator(const QSequentialIterable &iter, QAtomicInt *ref_); + explicit const_iterator(const QSequentialIterable &iter, QAtomicInt *ref); - explicit const_iterator(const QtMetaTypePrivate::QSequentialIterableImpl &impl, QAtomicInt *ref_); + explicit const_iterator(const QtMetaTypePrivate::QSequentialIterableImpl &impl, QAtomicInt *ref); public: ~const_iterator();