summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qdebug.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp
index 56c46d69c9..b0411f9dd9 100644
--- a/src/corelib/io/qdebug.cpp
+++ b/src/corelib/io/qdebug.cpp
@@ -438,10 +438,18 @@ public:
}
void restoreState()
{
+ const bool currentSpaces = m_dbg.autoInsertSpaces();
+ if (currentSpaces && !m_spaces)
+ if (m_dbg.stream->buffer.endsWith(QLatin1Char(' ')))
+ m_dbg.stream->buffer.chop(1);
+
m_dbg.setAutoInsertSpaces(m_spaces);
m_dbg.stream->ts.d_ptr->params = m_streamParams;
if (m_dbg.stream->context.version > 1)
m_dbg.stream->flags = m_flags;
+
+ if (!currentSpaces && m_spaces)
+ m_dbg.stream->ts << ' ';
}
QDebug &m_dbg;
@@ -475,7 +483,6 @@ QDebugStateSaver::QDebugStateSaver(QDebug &dbg)
QDebugStateSaver::~QDebugStateSaver()
{
d->restoreState();
- d->m_dbg.maybeSpace();
}
QT_END_NAMESPACE