From 326e9c8962532f66109f94f224f891c4445ce87f Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 16 Oct 2013 15:59:27 +0200 Subject: Remove trailing space from QDebug stream It's unexpected that all messages generated by the stream version of qDebug and friends have a trailing space. It also makes switching to categorized logging (which only supports the stream version) difficult, since all autotests checking for debug output would have to be adapted. Task-number: QTBUG-15256 Change-Id: I8d627a8379dc273d9689f5611184f03607b73823 Reviewed-by: Thiago Macieira --- src/corelib/io/qdebug.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/corelib/io/qdebug.h') diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 9ed5f6e951..b316c2866e 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -80,7 +80,9 @@ public: inline QDebug &operator=(const QDebug &other); inline ~QDebug() { if (!--stream->ref) { - if(stream->message_output) { + if (stream->space && stream->buffer.endsWith(QLatin1Char(' '))) + stream->buffer.chop(1); + if (stream->message_output) { QT_TRY { qt_message_output(stream->type, stream->context, -- cgit v1.2.3