summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstring.h
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-05-06 11:13:42 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2011-05-09 16:05:48 (GMT)
commit8447f5616be731d78081f326bb9cb3f5aa9087a4 (patch)
tree135f927439528851b1f06d62c002f06db2c50b82 /src/corelib/tools/qstring.h
parentebc134db484eee31491836b619aad1ee86e3070e (diff)
downloadQt-8447f5616be731d78081f326bb9cb3f5aa9087a4.zip
Qt-8447f5616be731d78081f326bb9cb3f5aa9087a4.tar.gz
Qt-8447f5616be731d78081f326bb9cb3f5aa9087a4.tar.bz2
QT_USE_QSTRINGBUILDER to fix source compatibility
In 4.8 we added support for using StringBuilder with QByteArray. But this is breaking source compatibility for people that used QT_USE_FAST_OPERATOR_PLUS in Qt 4.7. So we introduce a new macro Notice that QT_USE_FAST_CONCATENATION was not working without QT_USE_FAST_OPERATOR_PLUS, so we remove the checking of that macro. Reviewed-by: joao
Diffstat (limited to 'src/corelib/tools/qstring.h')
-rw-r--r--src/corelib/tools/qstring.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index 6418a8c..7c4367e 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -1016,8 +1016,7 @@ inline int QByteArray::findRev(const QString &s, int from) const
# endif // QT3_SUPPORT
#endif // QT_NO_CAST_TO_ASCII
-#ifndef QT_USE_FAST_OPERATOR_PLUS
-# ifndef QT_USE_FAST_CONCATENATION
+#if !defined(QT_USE_FAST_OPERATOR_PLUS) && !defined(QT_USE_QSTRINGBUILDER)
inline const QString operator+(const QString &s1, const QString &s2)
{ QString t(s1); t += s2; return t; }
inline const QString operator+(const QString &s1, QChar s2)
@@ -1038,8 +1037,7 @@ inline QT_ASCII_CAST_WARN const QString operator+(const QByteArray &ba, const QS
inline QT_ASCII_CAST_WARN const QString operator+(const QString &s, const QByteArray &ba)
{ QString t(s); t += QString::fromAscii(ba.constData(), qstrnlen(ba.constData(), ba.size())); return t; }
# endif // QT_NO_CAST_FROM_ASCII
-# endif // QT_USE_FAST_CONCATENATION
-#endif // QT_USE_FAST_OPERATOR_PLUS
+#endif // QT_USE_QSTRINGBUILDER
#ifndef QT_NO_STL
inline std::string QString::toStdString() const
@@ -1288,7 +1286,7 @@ QT_END_NAMESPACE
QT_END_HEADER
-#ifdef QT_USE_FAST_CONCATENATION
+#if defined(QT_USE_FAST_OPERATOR_PLUS) || defined(QT_USE_QSTRINGBUILDER)
#include <QtCore/qstringbuilder.h>
#endif