From: Stephen Kelly Date: Tue, 21 Feb 2012 21:18:26 +0000 (+0100) Subject: Remove use of Q_BROKEN_DEBUG_STREAM. X-Git-Tag: qt-v5.0.0-alpha1~847 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f783ec5347ac9962d011b2ff470082e083216367;p=profile%2Fivi%2Fqtbase.git 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 --- diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp index 1d6610a..a8c3921 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.cpp +++ b/src/corelib/itemmodels/qabstractitemmodel.cpp @@ -431,15 +431,9 @@ bool QPersistentModelIndex::isValid() const #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug dbg, const QModelIndex &idx) { -#ifndef Q_BROKEN_DEBUG_STREAM dbg.nospace() << "QModelIndex(" << idx.row() << ',' << idx.column() << ',' << idx.internalPointer() << ',' << idx.model() << ')'; return dbg.space(); -#else - qWarning("This compiler doesn't support streaming QModelIndex to QDebug"); - return dbg; - Q_UNUSED(idx); -#endif } QDebug operator<<(QDebug dbg, const QPersistentModelIndex &idx) diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp index 7f31128..c6c1f6f 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.cpp +++ b/src/corelib/itemmodels/qitemselectionmodel.cpp @@ -1622,15 +1622,9 @@ void QItemSelectionModel::emitSelectionChanged(const QItemSelection &newSelectio #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug dbg, const QItemSelectionRange &range) { -#ifndef Q_BROKEN_DEBUG_STREAM dbg.nospace() << "QItemSelectionRange(" << range.topLeft() << ',' << range.bottomRight() << ')'; return dbg.space(); -#else - qWarning("This compiler doesn't support streaming QItemSelectionRange to QDebug"); - return dbg; - Q_UNUSED(range); -#endif } #endif diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 252a713..8fa5dcd 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 9f57cd0..0b7866c 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(&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 cdae899..c428d81 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 QVariantDebugStream { diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index ce4594c..f99f3dd 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -2887,7 +2887,6 @@ QShortcutEvent::~QShortcutEvent() #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug dbg, const QEvent *e) { -#ifndef Q_BROKEN_DEBUG_STREAM // More useful event output could be added here if (!e) return dbg << "QEvent(this = 0x0)"; @@ -3168,11 +3167,6 @@ QDebug operator<<(QDebug dbg, const QEvent *e) { dbg.nospace() << 'Q' << n << "Event(" << (const void *)e << ')'; return dbg.space(); -#else - qWarning("This compiler doesn't support streaming QEvent to QDebug"); - return dbg; - Q_UNUSED(e); -#endif } #endif diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp index 8378650..2ebfb32 100644 --- a/src/gui/kernel/qguivariant.cpp +++ b/src/gui/kernel/qguivariant.cpp @@ -342,7 +342,7 @@ static bool convert(const QVariant::Private *d, QVariant::Type t, return qcoreVariantHandler()->convert(d, t, result, ok); } -#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(&v.data_ptr()); @@ -362,7 +362,7 @@ const QVariant::Handler qt_gui_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 diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index bd0f220..7053f01 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -1735,14 +1735,8 @@ QDataStream &operator>>(QDataStream &s, QKeySequence &keysequence) #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug dbg, const QKeySequence &p) { -#ifndef Q_BROKEN_DEBUG_STREAM dbg.nospace() << "QKeySequence(" << p.toString() << ')'; return dbg.space(); -#else - qWarning("This compiler doesn't support streaming QKeySequence to QDebug"); - return dbg; - Q_UNUSED(p); -#endif } #endif diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index c8dc370..6850eac 100644 --- a/src/gui/painting/qbrush.cpp +++ b/src/gui/painting/qbrush.cpp @@ -957,7 +957,6 @@ bool QBrush::operator==(const QBrush &b) const */ QDebug operator<<(QDebug dbg, const QBrush &b) { -#ifndef Q_BROKEN_DEBUG_STREAM static const char *BRUSH_STYLES[] = { "NoBrush", "SolidPattern", @@ -983,11 +982,6 @@ QDebug operator<<(QDebug dbg, const QBrush &b) dbg.nospace() << "QBrush(" << b.color() << ',' << BRUSH_STYLES[b.style()] << ')'; return dbg.space(); -#else - qWarning("This compiler doesn't support streaming QBrush to QDebug"); - return dbg; - Q_UNUSED(b); -#endif } #endif diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index 2c95434..9649191 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -2399,7 +2399,6 @@ void QColor::invalidate() #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug dbg, const QColor &c) { -#ifndef Q_BROKEN_DEBUG_STREAM if (!c.isValid()) dbg.nospace() << "QColor(Invalid)"; else if (c.spec() == QColor::Rgb) @@ -2413,11 +2412,6 @@ QDebug operator<<(QDebug dbg, const QColor &c) dbg.nospace() << "QColor(AHSL " << c.alphaF() << ", " << c.hslHueF() << ", " << c.hslSaturationF() << ", " << c.lightnessF() << ')'; return dbg.space(); -#else - qWarning("This compiler doesn't support streaming QColor to QDebug"); - return dbg; - Q_UNUSED(c); -#endif } #endif diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp index b6966b1..8d05eb5 100644 --- a/src/gui/painting/qpen.cpp +++ b/src/gui/painting/qpen.cpp @@ -985,7 +985,6 @@ QDataStream &operator>>(QDataStream &s, QPen &p) #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug dbg, const QPen &p) { -#ifndef Q_BROKEN_DEBUG_STREAM const char *PEN_STYLES[] = { "NoPen", "SolidLine", @@ -1002,11 +1001,6 @@ QDebug operator<<(QDebug dbg, const QPen &p) << ',' << p.dashOffset() << ',' << p.miterLimit() << ')'; return dbg.space(); -#else - qWarning("This compiler doesn't support streaming QPen to QDebug"); - return dbg; - Q_UNUSED(p); -#endif } #endif diff --git a/src/gui/painting/qpolygon.cpp b/src/gui/painting/qpolygon.cpp index 3a4860a..ee1f796 100644 --- a/src/gui/painting/qpolygon.cpp +++ b/src/gui/painting/qpolygon.cpp @@ -468,17 +468,11 @@ QRect QPolygon::boundingRect() const #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug dbg, const QPolygon &a) { -#ifndef Q_BROKEN_DEBUG_STREAM dbg.nospace() << "QPolygon("; for (int i = 0; i < a.count(); ++i) dbg.nospace() << a.at(i); dbg.nospace() << ')'; return dbg.space(); -#else - qWarning("This compiler doesn't support streaming QPolygon to QDebug"); - return dbg; - Q_UNUSED(a); -#endif } #endif @@ -814,17 +808,11 @@ QDataStream &operator>>(QDataStream &s, QPolygonF &a) #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug dbg, const QPolygonF &a) { -#ifndef Q_BROKEN_DEBUG_STREAM dbg.nospace() << "QPolygonF("; for (int i = 0; i < a.count(); ++i) dbg.nospace() << a.at(i); dbg.nospace() << ')'; return dbg.space(); -#else - qWarning("This compiler doesn't support streaming QPolygonF to QDebug"); - return dbg; - Q_UNUSED(a); -#endif } #endif diff --git a/src/sql/kernel/qsqlfield.cpp b/src/sql/kernel/qsqlfield.cpp index 5d01df1..3160d25 100644 --- a/src/sql/kernel/qsqlfield.cpp +++ b/src/sql/kernel/qsqlfield.cpp @@ -504,7 +504,6 @@ bool QSqlField::isValid() const #ifndef QT_NO_DEBUG_STREAM QDebug operator<<(QDebug dbg, const QSqlField &f) { -#ifndef Q_BROKEN_DEBUG_STREAM dbg.nospace() << "QSqlField(" << f.name() << ", " << QVariant::typeToName(f.type()); if (f.length() >= 0) dbg.nospace() << ", length: " << f.length(); @@ -520,11 +519,6 @@ QDebug operator<<(QDebug dbg, const QSqlField &f) dbg.nospace() << ", auto-value: \"" << f.defaultValue() << '\"'; dbg.nospace() << ')'; return dbg.space(); -#else - qWarning("This compiler doesn't support streaming QSqlField to QDebug"); - return dbg; - Q_UNUSED(f); -#endif } #endif diff --git a/src/widgets/kernel/qwidgetsvariant.cpp b/src/widgets/kernel/qwidgetsvariant.cpp index 72080d9..cf85cbf 100644 --- a/src/widgets/kernel/qwidgetsvariant.cpp +++ b/src/widgets/kernel/qwidgetsvariant.cpp @@ -127,7 +127,7 @@ static bool convert(const QVariant::Private *d, QVariant::Type type, void *resul return false; } -#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(&v.data_ptr()); @@ -157,7 +157,7 @@ static const QVariant::Handler widgets_handler = { compare, convert, 0, -#if !defined(QT_NO_DEBUG_STREAM) && !defined(Q_BROKEN_DEBUG_STREAM) +#if !defined(QT_NO_DEBUG_STREAM) streamDebug #else 0