Make QUuid compile with QT_NO_QUUID_STRING without breaking QDebug <<
authorJeremy Katz <jeremy.katz@nokia.com>
Mon, 18 Jun 2012 22:18:09 +0000 (00:18 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 20 Jun 2012 10:38:32 +0000 (12:38 +0200)
Change I0cbb0581a1c3abefdde75b7cd45fdafd31640f0d breaks the use of
operator<< for QDebug, which shows up when trying to link QtCore in
the small qconfig.

Instead, render QUuid as "QUuid(QT_NO_QUUID_STRING)".

Task-number: QTBUG-24816

Change-Id: Ia52283d7461a9907bcec7a110e41c9f830895efe
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@nokia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
src/corelib/plugin/quuid.cpp

index facd180..bfe8dfc 100644 (file)
@@ -986,10 +986,15 @@ QUuid QUuid::createUuid()
     guid; otherwise returns false.
 */
 
-#if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_NO_QUUID_STRING)
+#ifndef QT_NO_DEBUG_STREAM
 QDebug operator<<(QDebug dbg, const QUuid &id)
 {
+#ifndef QT_NO_QUUID_STRING
     dbg.nospace() << "QUuid(" << id.toString() << ')';
+#else
+    Q_UNUSED(id)
+    dbg.nospace() << "QUuid(QT_NO_QUUID_STRING)";
+#endif
     return dbg.space();
 }
 #endif