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>
bb10
Stephen Kelly 2012-02-21 22:18:26 +01:00 committed by Qt by Nokia
parent 4d0d49a92c
commit f783ec5347
14 changed files with 11 additions and 89 deletions

View 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)

View 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

View 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

View 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

View 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
{

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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