summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qbytearray.h
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2012-01-20 11:22:09 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-20 14:17:41 +0100
commit47d5d349d8f5bc590ca7cdf30bf13b69bddf3225 (patch)
treebe75994c1d77e479d562d571ef9cfaf48f9583d9 /src/corelib/tools/qbytearray.h
parent841b0c4fac8e8a96ebb2120b704cf7bbf1260543 (diff)
Remove QBool and use bool instead.
QBool was introduced with Qt-4.0, to detect Qt3-like code like if (c.contains(d) == 2) and break compilation on such constructs. This isn't necessary anymore, given that such code couldn't possibly compile in Qt4 times. And QBool was confusing developers, and creating compile errors (e.g. QVariant doesn't have support for it), so better remove it for Qt 5. Change-Id: I6642f43f5e12b872f98abb56600186179f072b09 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/tools/qbytearray.h')
-rw-r--r--src/corelib/tools/qbytearray.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index e96997909f..49da83b041 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -232,9 +232,9 @@ public:
int lastIndexOf(const char *c, int from = -1) const;
int lastIndexOf(const QByteArray &a, int from = -1) const;
- QBool contains(char c) const;
- QBool contains(const char *a) const;
- QBool contains(const QByteArray &a) const;
+ bool contains(char c) const;
+ bool contains(const char *a) const;
+ bool contains(const QByteArray &a) const;
int count(char c) const;
int count(const char *a) const;
int count(const QByteArray &a) const;
@@ -523,10 +523,10 @@ inline void QByteArray::push_front(const char *c)
{ prepend(c); }
inline void QByteArray::push_front(const QByteArray &a)
{ prepend(a); }
-inline QBool QByteArray::contains(const QByteArray &a) const
-{ return QBool(indexOf(a) != -1); }
-inline QBool QByteArray::contains(char c) const
-{ return QBool(indexOf(c) != -1); }
+inline bool QByteArray::contains(const QByteArray &a) const
+{ return indexOf(a) != -1; }
+inline bool QByteArray::contains(char c) const
+{ return indexOf(c) != -1; }
inline bool operator==(const QByteArray &a1, const QByteArray &a2)
{ return (a1.size() == a2.size()) && (memcmp(a1.constData(), a2.constData(), a1.size())==0); }
inline bool operator==(const QByteArray &a1, const char *a2)
@@ -575,8 +575,8 @@ inline const QByteArray operator+(const char *a1, const QByteArray &a2)
inline const QByteArray operator+(char a1, const QByteArray &a2)
{ return QByteArray(&a1, 1) += a2; }
#endif // QT_USE_QSTRINGBUILDER
-inline QBool QByteArray::contains(const char *c) const
-{ return QBool(indexOf(c) != -1); }
+inline bool QByteArray::contains(const char *c) const
+{ return indexOf(c) != -1; }
inline QByteArray &QByteArray::replace(char before, const char *c)
{ return replace(&before, 1, c, qstrlen(c)); }
inline QByteArray &QByteArray::replace(const QByteArray &before, const char *c)