Remove use of Q_BROKEN_DEBUG_STREAM.
authorStephen Kelly <stephen.kelly@kdab.com>
Tue, 21 Feb 2012 21:18:26 +0000 (22:18 +0100)
committerQt by Nokia <qt-info@nokia.com>
Wed, 22 Feb 2012 18:25:06 +0000 (19:25 +0100)
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>
14 files changed:
src/corelib/itemmodels/qabstractitemmodel.cpp
src/corelib/itemmodels/qitemselectionmodel.cpp
src/corelib/kernel/qobject.cpp
src/corelib/kernel/qvariant.cpp
src/corelib/kernel/qvariant_p.h
src/gui/kernel/qevent.cpp
src/gui/kernel/qguivariant.cpp
src/gui/kernel/qkeysequence.cpp
src/gui/painting/qbrush.cpp
src/gui/painting/qcolor.cpp
src/gui/painting/qpen.cpp
src/gui/painting/qpolygon.cpp
src/sql/kernel/qsqlfield.cpp
src/widgets/kernel/qwidgetsvariant.cpp

index 1d6610a..a8c3921 100644 (file)
@@ -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)
index 7f31128..c6c1f6f 100644 (file)
@@ -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
 
index 252a713..8fa5dcd 100644 (file)
@@ -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
 
index 9f57cd0..0b7866c 100644 (file)
@@ -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
 
index cdae899..c428d81 100644 (file)
@@ -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
 {
index ce4594c..f99f3dd 100644 (file)
@@ -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
 
index 8378650..2ebfb32 100644 (file)
@@ -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<QVariant::Private *>(&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
index bd0f220..7053f01 100644 (file)
@@ -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
 
index c8dc370..6850eac 100644 (file)
@@ -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
 
index 2c95434..9649191 100644 (file)
@@ -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
 
index b6966b1..8d05eb5 100644 (file)
@@ -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
 
index 3a4860a..ee1f796 100644 (file)
@@ -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
 
index 5d01df1..3160d25 100644 (file)
@@ -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
 
index 72080d9..cf85cbf 100644 (file)
@@ -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<QVariant::Private *>(&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