diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2012-01-11 10:06:29 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2012-01-11 14:58:19 +0100 |
commit | 763d19bd197e9c74f9b7775f22abf73b7786eeef (patch) | |
tree | 19b5836d30c5102b23cebafe0434bf25ea3ae1e6 | |
parent | 482d34d2babcfd7827bc366df9a324a6d901817e (diff) |
Remove the QT_STRICT_ITERATOR defines
They aren't needed here, as we don't give
direct access to the data in the object or
array. QJsonValueRef will call setters
on the object or array causing the detach
to happen at modification time.
Change-Id: I3bbd6068f14ad641c238a2f1ca694c86e360e56f
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
-rw-r--r-- | src/qjsonarray.h | 7 | ||||
-rw-r--r-- | src/qjsonobject.h | 11 |
2 files changed, 1 insertions, 17 deletions
diff --git a/src/qjsonarray.h b/src/qjsonarray.h index 24b6769..7eb0997 100644 --- a/src/qjsonarray.h +++ b/src/qjsonarray.h @@ -116,14 +116,12 @@ public: inline bool operator<=(const iterator& other) const { return i <= other.i; } inline bool operator>(const iterator& other) const { return i > other.i; } inline bool operator>=(const iterator& other) const { return i >= other.i; } -#ifndef QT_STRICT_ITERATORS inline bool operator==(const const_iterator &o) const { return i == o.i; } inline bool operator!=(const const_iterator &o) const { return i != o.i; } inline bool operator<(const const_iterator& other) const { return i < other.i; } inline bool operator<=(const const_iterator& other) const { return i <= other.i; } inline bool operator>(const const_iterator& other) const { return i > other.i; } inline bool operator>=(const const_iterator& other) const { return i >= other.i; } -#endif inline iterator &operator++() { ++i; return *this; } inline iterator operator++(int) { iterator n = *this; ++i; return n; } inline iterator &operator--() { i--; return *this; } @@ -149,11 +147,8 @@ public: inline const_iterator() : a(0), i(0) { } explicit inline const_iterator(const QJsonArray *array, int index) : a(array), i(index) { } inline const_iterator(const const_iterator &o) : a(o.a), i(o.i) {} -#ifdef QT_STRICT_ITERATORS - inline explicit const_iterator(const iterator &o): a(o.a), i(o.i) {} -#else inline const_iterator(const iterator &o) : a(o.a), i(o.i) {} -#endif + inline QJsonValue operator*() const { return a->at(i); } //inline T *operator->() const { return &concrete(i)->value; } inline QJsonValue operator[](int j) const { return a->at(i+j); } diff --git a/src/qjsonobject.h b/src/qjsonobject.h index 8bbbdd1..9bee307 100644 --- a/src/qjsonobject.h +++ b/src/qjsonobject.h @@ -116,11 +116,7 @@ public: inline iterator &operator+=(int j) { i += j; return *this; } inline iterator &operator-=(int j) { i -= j; return *this; } -#ifdef QT_STRICT_ITERATORS - private: -#else public: -#endif inline bool operator==(const const_iterator &other) const { return i == other.i; } inline bool operator!=(const const_iterator &other) const { return i != other.i; } }; @@ -142,11 +138,7 @@ public: inline const_iterator() : o(0), i(0) {} explicit inline const_iterator(const QJsonObject *obj, int index) : o(obj), i(index) {} -#ifdef QT_STRICT_ITERATORS - explicit inline const_iterator(const iterator &other) -#else inline const_iterator(const iterator &other) -#endif : o(other.o), i(other.i) {} inline QString key() const { return o->keyAt(i); } @@ -166,11 +158,8 @@ public: inline const_iterator &operator+=(int j) { i += j; return *this; } inline const_iterator &operator-=(int j) { i -= j; return *this; } -#ifdef QT_STRICT_ITERATORS - private: inline bool operator==(const iterator &o) const { return i == o.i; } inline bool operator!=(const iterator &o) const { return i != o.i; } -#endif }; friend class const_iterator; |