Fix compilation of Qt itself with QT_NO_DEBUG_STREAM
authorDavid Faure <faure@kde.org>
Thu, 12 Jan 2012 11:49:20 +0000 (12:49 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 12 Jan 2012 15:15:00 +0000 (16:15 +0100)
Change-Id: I07087dff0f109347ea80434f17eeb7cc1c13114c
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
src/gui/opengl/qopenglengineshadermanager.cpp
src/network/access/qhttpthreaddelegate.cpp
src/network/access/qnetworkreplyhttpimpl.cpp
src/network/access/qnetworkreplyimpl.cpp
src/opengl/gl2paintengineex/qglengineshadermanager.cpp
src/sql/drivers/odbc/qsql_odbc.cpp
src/widgets/kernel/qwidgetsvariant.cpp

index da9952a..9520f07 100644 (file)
@@ -247,8 +247,7 @@ QOpenGLEngineSharedShaders::QOpenGLEngineSharedShaders(QOpenGLContext* context)
         if (!inCache)
             simpleShaderCache.store(simpleShaderProg, context);
     } else {
-        qCritical() << "Errors linking simple shader:"
-                    << simpleShaderProg->log();
+        qCritical("Errors linking simple shader: %s", qPrintable(simpleShaderProg->log()));
     }
 
     // Compile the blit shader:
@@ -289,8 +288,7 @@ QOpenGLEngineSharedShaders::QOpenGLEngineSharedShaders(QOpenGLContext* context)
         if (!inCache)
             blitShaderCache.store(blitShaderProg, context);
     } else {
-        qCritical() << "Errors linking blit shader:"
-                    << blitShaderProg->log();
+        qCritical("Errors linking blit shader: %s", qPrintable(blitShaderProg->log()));
     }
 
 #ifdef QT_GL_SHARED_SHADER_DEBUG
index 323b7c7..39a7e8e 100644 (file)
@@ -364,7 +364,7 @@ void QHttpThreadDelegate::readyReadSlot()
 void QHttpThreadDelegate::finishedSlot()
 {
     if (!httpReply) {
-        qWarning() << "QHttpThreadDelegate::finishedSlot: HTTP reply had already been deleted, internal problem. Please report.";
+        qWarning("QHttpThreadDelegate::finishedSlot: HTTP reply had already been deleted, internal problem. Please report.");
         return;
     }
 #ifdef QHTTPTHREADDELEGATE_DEBUG
@@ -420,7 +420,7 @@ void QHttpThreadDelegate::synchronousFinishedSlot()
 void QHttpThreadDelegate::finishedWithErrorSlot(QNetworkReply::NetworkError errorCode, const QString &detail)
 {
     if (!httpReply) {
-        qWarning() << "QHttpThreadDelegate::finishedWithErrorSlot: HTTP reply had already been deleted, internal problem. Please report.";
+        qWarning("QHttpThreadDelegate::finishedWithErrorSlot: HTTP reply had already been deleted, internal problem. Please report.");
         return;
     }
 #ifdef QHTTPTHREADDELEGATE_DEBUG
index a8b0a3e..48767f5 100644 (file)
@@ -1846,7 +1846,7 @@ void QNetworkReplyHttpImplPrivate::error(QNetworkReplyImpl::NetworkError code, c
     Q_Q(QNetworkReplyHttpImpl);
     // Can't set and emit multiple errors.
     if (errorCode != QNetworkReply::NoError) {
-        qWarning() << "QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.";
+        qWarning("QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.");
         return;
     }
 
@@ -1959,7 +1959,7 @@ void QNetworkReplyHttpImplPrivate::setCachingEnabled(bool enable)
 
     if (enable) {
         if (bytesDownloaded) {
-            qDebug() << "x" << bytesDownloaded;
+            qDebug("setCachingEnabled: %d bytesDownloaded", bytesDownloaded);
             // refuse to enable in this case
             qCritical("QNetworkReplyImpl: backend error: caching was enabled after some bytes had been written");
             return;
index 14b4f8b..82579f0 100644 (file)
@@ -780,7 +780,7 @@ void QNetworkReplyImplPrivate::error(QNetworkReplyImpl::NetworkError code, const
     Q_Q(QNetworkReplyImpl);
     // Can't set and emit multiple errors.
     if (errorCode != QNetworkReply::NoError) {
-        qWarning() << "QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.";
+        qWarning( "QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.");
         return;
     }
 
index 8755fbc..4daed7e 100644 (file)
@@ -246,8 +246,7 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context)
         if (!inCache)
             simpleShaderCache.store(simpleShaderProg, context);
     } else {
-        qCritical() << "Errors linking simple shader:"
-                    << simpleShaderProg->log();
+        qCritical("Errors linking simple shader: %s", qPrintable(simpleShaderProg->log()));
     }
 
     // Compile the blit shader:
@@ -288,8 +287,7 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context)
         if (!inCache)
             blitShaderCache.store(blitShaderProg, context);
     } else {
-        qCritical() << "Errors linking blit shader:"
-                    << blitShaderProg->log();
+        qCritical("Errors linking blit shader: %s", qPrintable(blitShaderProg->log()));
     }
 
 #ifdef QT_GL_SHARED_SHADER_DEBUG
index ed7700e..f0d66ea 100644 (file)
@@ -84,7 +84,7 @@ inline static QString fromSQLTCHAR(const QVarLengthArray<SQLTCHAR>& input, int s
             result=QString::fromUcs4((const uint *)input.constData(), realsize);
             break;
         default:
-            qCritical() << "sizeof(SQLTCHAR) is " << sizeof(SQLTCHAR) << "Don't know how to handle this";
+            qCritical("sizeof(SQLTCHAR) is %d. Don't know how to handle this.", sizeof(SQLTCHAR));
     }
     return result;
 }
@@ -104,7 +104,7 @@ inline static QVarLengthArray<SQLTCHAR> toSQLTCHAR(const QString &input)
             memcpy(result.data(), input.toUcs4().data(), input.size() * 4);
             break;
         default:
-            qCritical() << "sizeof(SQLTCHAR) is " << sizeof(SQLTCHAR) << "Don't know how to handle this";
+            qCritical("sizeof(SQLTCHAR) is %d. Don't know how to handle this.", sizeof(SQLTCHAR));
     }
     result.append(0); // make sure it's null terminated, doesn't matter if it already is, it does if it isn't.
     return result;
index e9fa99a..f2ca99d 100644 (file)
@@ -127,6 +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)
 static void streamDebug(QDebug dbg, const QVariant &v)
 {
     QVariant::Private *d = const_cast<QVariant::Private *>(&v.data_ptr());
@@ -143,6 +144,7 @@ static void streamDebug(QDebug dbg, const QVariant &v)
         dbg.nospace() << "QVariant::Type(" << d->type << ")";
     }
 }
+#endif
 
 static const QVariant::Handler widgets_handler = {
     construct,