From 868201155fd677dbc6d14346f5ea61e82ebce27b Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 23 Jan 2015 16:19:11 +0100 Subject: QtCore: Use QDebugStateSaver in (almost) all QDebug operator<< Unify the behavior of the different operator<< by always using QDebugStateSaver (appending an optional space at exit), and making sure that the space(), nospace() setting isn't 'leaked'. Change-Id: I38e4f82fa6f7419d8b5edfc4dc37495af497e8ac Reviewed-by: Alex Blasche --- src/corelib/json/qjsondocument.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/corelib/json/qjsondocument.cpp') diff --git a/src/corelib/json/qjsondocument.cpp b/src/corelib/json/qjsondocument.cpp index 6e64df42ad..fe8bfdf0b5 100644 --- a/src/corelib/json/qjsondocument.cpp +++ b/src/corelib/json/qjsondocument.cpp @@ -561,6 +561,7 @@ bool QJsonDocument::isNull() const #if !defined(QT_NO_DEBUG_STREAM) && !defined(QT_JSON_READONLY) QDebug operator<<(QDebug dbg, const QJsonDocument &o) { + QDebugStateSaver saver(dbg); if (!o.d) { dbg << "QJsonDocument()"; return dbg; @@ -573,7 +574,7 @@ QDebug operator<<(QDebug dbg, const QJsonDocument &o) dbg.nospace() << "QJsonDocument(" << json.constData() // print as utf-8 string without extra quotation marks << ")"; - return dbg.space(); + return dbg; } #endif -- cgit v1.2.3