diff options
Diffstat (limited to 'src/corelib/io/qdebug.h')
-rw-r--r-- | src/corelib/io/qdebug.h | 50 |
1 files changed, 1 insertions, 49 deletions
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index bdaaa05768..584d6bf41f 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -78,20 +78,7 @@ public: inline QDebug(QtMsgType t) : stream(new Stream(t)) {} inline QDebug(const QDebug &o):stream(o.stream) { ++stream->ref; } inline QDebug &operator=(const QDebug &other); - inline ~QDebug() { - if (!--stream->ref) { - if (stream->space && stream->buffer.endsWith(QLatin1Char(' '))) - stream->buffer.chop(1); - if (stream->message_output) { - QT_TRY { - qt_message_output(stream->type, - stream->context, - stream->buffer); - } QT_CATCH(std::bad_alloc&) { /* We're out of memory - give up. */ } - } - delete stream; - } - } + ~QDebug(); inline void swap(QDebug &other) { qSwap(stream, other.stream); } inline QDebug &space() { stream->space = true; stream->ts << ' '; return *this; } @@ -164,13 +151,8 @@ inline QDebug &QDebug::operator=(const QDebug &other) return *this; } -#if defined(FORCE_UREF) -template <class T> -inline QDebug &operator<<(QDebug debug, const QList<T> &list) -#else template <class T> inline QDebug operator<<(QDebug debug, const QList<T> &list) -#endif { const bool oldSetting = debug.autoInsertSpaces(); debug.nospace() << '('; @@ -184,13 +166,8 @@ inline QDebug operator<<(QDebug debug, const QList<T> &list) return debug.maybeSpace(); } -#if defined(FORCE_UREF) -template <typename T> -inline QDebug &operator<<(QDebug debug, const QVector<T> &vec) -#else template <typename T> inline QDebug operator<<(QDebug debug, const QVector<T> &vec) -#endif { const bool oldSetting = debug.autoInsertSpaces(); debug.nospace() << "QVector"; @@ -198,13 +175,8 @@ inline QDebug operator<<(QDebug debug, const QVector<T> &vec) return operator<<(debug, vec.toList()); } -#if defined(FORCE_UREF) -template <class aKey, class aT> -inline QDebug &operator<<(QDebug debug, const QMap<aKey, aT> &map) -#else template <class aKey, class aT> inline QDebug operator<<(QDebug debug, const QMap<aKey, aT> &map) -#endif { const bool oldSetting = debug.autoInsertSpaces(); debug.nospace() << "QMap("; @@ -217,13 +189,8 @@ inline QDebug operator<<(QDebug debug, const QMap<aKey, aT> &map) return debug.maybeSpace(); } -#if defined(FORCE_UREF) -template <class aKey, class aT> -inline QDebug &operator<<(QDebug debug, const QHash<aKey, aT> &hash) -#else template <class aKey, class aT> inline QDebug operator<<(QDebug debug, const QHash<aKey, aT> &hash) -#endif { const bool oldSetting = debug.autoInsertSpaces(); debug.nospace() << "QHash("; @@ -235,13 +202,8 @@ inline QDebug operator<<(QDebug debug, const QHash<aKey, aT> &hash) return debug.maybeSpace(); } -#if defined(FORCE_UREF) -template <class T1, class T2> -inline QDebug &operator<<(QDebug debug, const QPair<T1, T2> &pair) -#else template <class T1, class T2> inline QDebug operator<<(QDebug debug, const QPair<T1, T2> &pair) -#endif { const bool oldSetting = debug.autoInsertSpaces(); debug.nospace() << "QPair(" << pair.first << ',' << pair.second << ')'; @@ -258,13 +220,8 @@ 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 { const bool oldSetting = debug.autoInsertSpaces(); debug.nospace() << "QContiguousCache("; @@ -278,13 +235,8 @@ inline QDebug operator<<(QDebug debug, const QContiguousCache<T> &cache) return debug.maybeSpace(); } -#if defined(FORCE_UREF) -template <class T> -inline QDebug &operator<<(QDebug debug, const QFlags<T> &flags) -#else template <class T> inline QDebug operator<<(QDebug debug, const QFlags<T> &flags) -#endif { const bool oldSetting = debug.autoInsertSpaces(); debug.nospace() << "QFlags("; |