diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2012-02-21 22:18:26 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-22 19:25:06 +0100 |
commit | f783ec5347ac9962d011b2ff470082e083216367 (patch) | |
tree | bebb0be46a14f0a8f60ce31c48a1dd8ae8a61cfa /src/corelib/kernel | |
parent | 4d0d49a92cca46555a5e3ed482b7d7f50ea3655a (diff) |
Remove use of Q_BROKEN_DEBUG_STREAM.
No supported compiler defines it, and it was not used consistently
so it didn't work anyway.
Change-Id: Icc9e911e22daaedaee3d9316c15d19be26cd2e72
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 6 | ||||
-rw-r--r-- | src/corelib/kernel/qvariant.cpp | 24 | ||||
-rw-r--r-- | src/corelib/kernel/qvariant_p.h | 2 |
3 files changed, 7 insertions, 25 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 252a713872..8fa5dcdcff 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -3617,7 +3617,6 @@ QObjectUserData* QObject::userData(uint id) const #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug dbg, const QObject *o) { -#ifndef Q_BROKEN_DEBUG_STREAM if (!o) return dbg << "QObject(0x0) "; dbg.nospace() << o->metaObject()->className() << '(' << (void *)o; @@ -3625,11 +3624,6 @@ QDebug operator<<(QDebug dbg, const QObject *o) { dbg << ", name = " << o->objectName(); dbg << ')'; return dbg.space(); -#else - qWarning("This compiler doesn't support streaming QObject to QDebug"); - return dbg; - Q_UNUSED(o); -#endif } #endif diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 9f57cd018c..0b7866c3eb 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -732,7 +732,7 @@ static bool convert(const QVariant::Private *d, QVariant::Type t, void *result, return true; } -#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM) +#if !defined(QT_NO_DEBUG_STREAM) static void streamDebug(QDebug dbg, const QVariant &v) { QVariant::Private *d = const_cast<QVariant::Private *>(&v.data_ptr()); @@ -752,7 +752,7 @@ const QVariant::Handler qt_kernel_variant_handler = { compare, convert, 0, -#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM) +#if !defined(QT_NO_DEBUG_STREAM) streamDebug #else 0 @@ -764,7 +764,7 @@ static void dummyClear(QVariant::Private *) { Q_ASSERT_X(false, "QVariant", "Try static bool dummyIsNull(const QVariant::Private *d) { Q_ASSERT_X(false, "QVariant::isNull", "Trying to call isNull on an unknown type"); return d->is_null; } static bool dummyCompare(const QVariant::Private *, const QVariant::Private *) { Q_ASSERT_X(false, "QVariant", "Trying to compare an unknown types"); return false; } static bool dummyConvert(const QVariant::Private *, QVariant::Type , void *, bool *) { Q_ASSERT_X(false, "QVariant", "Trying to convert an unknown type"); return false; } -#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM) +#if !defined(QT_NO_DEBUG_STREAM) static void dummyStreamDebug(QDebug, const QVariant &) { Q_ASSERT_X(false, "QVariant", "Trying to convert an unknown type"); } #endif const QVariant::Handler qt_dummy_variant_handler = { @@ -778,7 +778,7 @@ const QVariant::Handler qt_dummy_variant_handler = { dummyCompare, dummyConvert, 0, -#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM) +#if !defined(QT_NO_DEBUG_STREAM) dummyStreamDebug #else 0 @@ -847,7 +847,7 @@ static bool customConvert(const QVariant::Private *, QVariant::Type, void *, boo return false; } -#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM) +#if !defined(QT_NO_DEBUG_STREAM) static void customStreamDebug(QDebug, const QVariant &) {} #endif @@ -862,7 +862,7 @@ const QVariant::Handler qt_custom_variant_handler = { customCompare, customConvert, 0, -#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM) +#if !defined(QT_NO_DEBUG_STREAM) customStreamDebug #else 0 @@ -2644,28 +2644,16 @@ bool QVariant::isNull() const #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug dbg, const QVariant &v) { -#ifndef Q_BROKEN_DEBUG_STREAM dbg.nospace() << "QVariant(" << QMetaType::typeName(v.userType()) << ", "; handlerManager[v.d.type]->debugStream(dbg, v); dbg.nospace() << ')'; return dbg.space(); -#else - qWarning("This compiler doesn't support streaming QVariant to QDebug"); - return dbg; - Q_UNUSED(v); -#endif } QDebug operator<<(QDebug dbg, const QVariant::Type p) { -#ifndef Q_BROKEN_DEBUG_STREAM dbg.nospace() << "QVariant::" << QMetaType::typeName(p); return dbg.space(); -#else - qWarning("This compiler doesn't support streaming QVariant::Type to QDebug"); - return dbg; - Q_UNUSED(p); -#endif } #endif diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h index cdae8997a7..c428d81bb4 100644 --- a/src/corelib/kernel/qvariant_p.h +++ b/src/corelib/kernel/qvariant_p.h @@ -410,7 +410,7 @@ Q_CORE_EXPORT void registerHandler(const int /* Modules::Names */ name, const QV Q_CORE_EXPORT void unregisterHandler(const int /* Modules::Names */ name); } -#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM) +#if !defined(QT_NO_DEBUG_STREAM) template<class Filter> class QVariantDebugStream { |