From 21f15b50777ab3507f79061e749c5cee9acecb3b Mon Sep 17 00:00:00 2001 From: Ian Walters Date: Wed, 8 Apr 2009 10:05:27 +1000 Subject: Move qDebug code to correct location --- src/corelib/io/qdebug.h | 19 +++++++++++++++++ .../auto/qcontiguouscache/tst_qcontiguouscache.cpp | 24 ---------------------- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 8334146..6c05756 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -51,6 +51,7 @@ #include #include #include +#include QT_BEGIN_HEADER @@ -232,6 +233,24 @@ inline QDebug operator<<(QDebug debug, const QSet &set) return operator<<(debug, set.toList()); } +#if defined(FORCE_UREF) +template +inline QDebug &operator<<(QDebug debug, const QContiguousCache &contiguousCache) +#else +template +inline QDebug operator<<(QDebug debug, const QContiguousCache &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); } diff --git a/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp b/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp index 6580f87..91f6a9c 100644 --- a/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp +++ b/tests/auto/qcontiguouscache/tst_qcontiguouscache.cpp @@ -49,30 +49,6 @@ #include #include - -#if defined(FORCE_UREF) -template -inline QDebug &operator<<(QDebug debug, const QContiguousCache &contiguousCache) -#else -template -inline QDebug operator<<(QDebug debug, const QContiguousCache &contiguousCache) -#endif -{ - debug.nospace() << "QContiguousCache("; - for (int i = contiguousCache.firstIndex(); i <= contiguousCache.lastIndex(); ++i) { - debug << contiguousCache[i]; - if (i != contiguousCache.lastIndex()) - debug << ", "; - } - debug << ")"; - return debug.space(); -} - -#if defined(NO_BENCHMARK) and defined(QBENCHMARK) -#undef QBENCHMARK -#define QBENCHMARK -#endif - class tst_QContiguousCache : public QObject { Q_OBJECT -- cgit v0.12