summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qdebug.h
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-06-25 15:49:53 +0200
committerJason Barron <jbarron@trolltech.com>2009-06-25 15:49:53 +0200
commitdb8f05e257019694f5e8076845626008f2adc3dd (patch)
tree05d3959403cf15ac5f702091439e028af01f343b /src/corelib/io/qdebug.h
parent8aafaa65a1d16f8b982279f5aceedf1e281ddb5a (diff)
parent796a5a2c7d8c91a46ac761dde18b7da2ec6c177b (diff)
Merge commit 'qt/master-stable' into 4.6-stable
Bring Qt 4.6 into the Qt-S60 repo. Conflicts: configure.exe mkspecs/features/qttest_p4.prf qmake/generators/makefile.cpp src/corelib/io/qdir.cpp src/corelib/io/qprocess.h src/corelib/kernel/qcoreevent.h src/corelib/kernel/qobject.cpp src/corelib/kernel/qsharedmemory_unix.cpp src/corelib/thread/qthread_p.h src/corelib/tools/qvector.h src/gui/dialogs/qdialog.cpp src/gui/dialogs/qfiledialog.cpp src/gui/dialogs/qfiledialog_p.h src/gui/dialogs/qmessagebox.cpp src/gui/graphicsview/qgraphicsitem.cpp src/gui/graphicsview/qgraphicsview.cpp src/gui/image/qpixmapcache.cpp src/gui/kernel/qapplication.cpp src/gui/kernel/qapplication_p.h src/gui/kernel/qwidget.cpp src/gui/kernel/qwidget_p.h src/gui/painting/qdrawhelper.cpp src/gui/painting/qpaintengine_raster.cpp src/gui/text/qfontengine_qpf.cpp src/gui/widgets/qmenubar.cpp src/network/socket/qlocalserver.cpp src/testlib/qtestcase.cpp src/testlib/testlib.pro tests/auto/qimagereader/tst_qimagereader.cpp tests/auto/qitemdelegate/tst_qitemdelegate.cpp tests/auto/qnetworkreply/tst_qnetworkreply.cpp tests/auto/qpixmap/qpixmap.pro
Diffstat (limited to 'src/corelib/io/qdebug.h')
-rw-r--r--src/corelib/io/qdebug.h45
1 files changed, 32 insertions, 13 deletions
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h
index 60dc6887c5..332058edd3 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -51,6 +51,7 @@
#include <QtCore/qstring.h>
#include <QtCore/qvector.h>
#include <QtCore/qset.h>
+#include <QtCore/qcontiguouscache.h>
QT_BEGIN_HEADER
@@ -87,11 +88,11 @@ public:
delete stream;
}
}
- inline QDebug &space() { stream->space = true; stream->ts << " "; return *this; }
+ inline QDebug &space() { stream->space = true; stream->ts << ' '; return *this; }
inline QDebug &nospace() { stream->space = false; return *this; }
- inline QDebug &maybeSpace() { if (stream->space) stream->ts << " "; return *this; }
+ inline QDebug &maybeSpace() { if (stream->space) stream->ts << ' '; return *this; }
- inline QDebug &operator<<(QChar t) { stream->ts << "\'" << t << "\'"; return maybeSpace(); }
+ inline QDebug &operator<<(QChar t) { stream->ts << '\'' << t << '\''; return maybeSpace(); }
inline QDebug &operator<<(QBool t) { stream->ts << (bool(t) ? "true" : "false"); return maybeSpace(); }
inline QDebug &operator<<(bool t) { stream->ts << (t ? "true" : "false"); return maybeSpace(); }
inline QDebug &operator<<(char t) { stream->ts << t; return maybeSpace(); }
@@ -108,10 +109,10 @@ public:
inline QDebug &operator<<(float t) { stream->ts << t; return maybeSpace(); }
inline QDebug &operator<<(double t) { stream->ts << t; return maybeSpace(); }
inline QDebug &operator<<(const char* t) { stream->ts << QString::fromAscii(t); return maybeSpace(); }
- inline QDebug &operator<<(const QString & t) { stream->ts << "\"" << t << "\""; return maybeSpace(); }
+ inline QDebug &operator<<(const QString & t) { stream->ts << '\"' << t << '\"'; return maybeSpace(); }
inline QDebug &operator<<(const QStringRef & t) { return operator<<(t.toString()); }
- inline QDebug &operator<<(const QLatin1String &t) { stream->ts << "\"" << t.latin1() << "\""; return maybeSpace(); }
- inline QDebug &operator<<(const QByteArray & t) { stream->ts << "\"" << t << "\""; return maybeSpace(); }
+ inline QDebug &operator<<(const QLatin1String &t) { stream->ts << '\"' << t.latin1() << '\"'; return maybeSpace(); }
+ inline QDebug &operator<<(const QByteArray & t) { stream->ts << '\"' << t << '\"'; return maybeSpace(); }
inline QDebug &operator<<(const void * t) { stream->ts << t; return maybeSpace(); }
inline QDebug &operator<<(QTextStreamFunction f) {
stream->ts << f;
@@ -161,13 +162,13 @@ template <class T>
inline QDebug operator<<(QDebug debug, const QList<T> &list)
#endif
{
- debug.nospace() << "(";
+ debug.nospace() << '(';
for (Q_TYPENAME QList<T>::size_type i = 0; i < list.count(); ++i) {
if (i)
debug << ", ";
debug << list.at(i);
}
- debug << ")";
+ debug << ')';
return debug.space();
}
@@ -194,9 +195,9 @@ inline QDebug operator<<(QDebug debug, const QMap<aKey, aT> &map)
debug.nospace() << "QMap(";
for (typename QMap<aKey, aT>::const_iterator it = map.constBegin();
it != map.constEnd(); ++it) {
- debug << "(" << it.key() << ", " << it.value() << ")";
+ debug << '(' << it.key() << ", " << it.value() << ')';
}
- debug << ")";
+ debug << ')';
return debug.space();
}
@@ -211,8 +212,8 @@ inline QDebug operator<<(QDebug debug, const QHash<aKey, aT> &hash)
debug.nospace() << "QHash(";
for (typename QHash<aKey, aT>::const_iterator it = hash.constBegin();
it != hash.constEnd(); ++it)
- debug << "(" << it.key() << ", " << it.value() << ")";
- debug << ")";
+ debug << '(' << it.key() << ", " << it.value() << ')';
+ debug << ')';
return debug.space();
}
@@ -224,7 +225,7 @@ template <class T1, class T2>
inline QDebug operator<<(QDebug debug, const QPair<T1, T2> &pair)
#endif
{
- debug.nospace() << "QPair(" << pair.first << "," << pair.second << ")";
+ debug.nospace() << "QPair(" << pair.first << ',' << pair.second << ')';
return debug.space();
}
@@ -235,6 +236,24 @@ inline QDebug operator<<(QDebug debug, const QSet<T> &set)
return operator<<(debug, set.toList());
}
+#if defined(FORCE_UREF)
+template <class T>
+inline QDebug &operator<<(QDebug debug, const QContiguousCache<T> &cache)
+#else
+template <class T>
+inline QDebug operator<<(QDebug debug, const QContiguousCache<T> &cache)
+#endif
+{
+ debug.nospace() << "QContiguousCache(";
+ for (int i = cache.firstIndex(); i <= cache.lastIndex(); ++i) {
+ debug << cache[i];
+ if (i != cache.lastIndex())
+ debug << ", ";
+ }
+ debug << ')';
+ return debug.space();
+}
+
#if !defined(QT_NO_DEBUG_STREAM)
Q_CORE_EXPORT_INLINE QDebug qDebug() { return QDebug(QtDebugMsg); }