Fix debug stream operators.
- Use QDebugStateSaver to restore space setting in stream operators instead of returning dbg.space() which breaks formatting on streams that already have nospace() set. - Fix some single character string constants, streamline code. Change-Id: I18ae7324b172ea801aa9b5fe56ddf6fe527fdde9 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
This commit is contained in:
@@ -62,8 +62,9 @@ struct PtrWrapper
|
||||
template <typename T>
|
||||
inline QDebug& operator<<(QDebug &debug, const Trace::PtrWrapper<T> &wrapper)
|
||||
{
|
||||
debug.nospace() << "[" << (void*)wrapper.m_ptr << "]";
|
||||
return debug.space();
|
||||
QDebugStateSaver saver(debug);
|
||||
debug.nospace() << '[' << static_cast<const void *>(wrapper.m_ptr) << ']';
|
||||
return debug;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
||||
@@ -62,8 +62,9 @@ struct PtrWrapper
|
||||
template <typename T>
|
||||
inline QDebug &operator<<(QDebug &debug, const Trace::PtrWrapper<T> &wrapper)
|
||||
{
|
||||
debug.nospace() << "[" << (void*)wrapper.m_ptr << "]";
|
||||
return debug.space();
|
||||
QDebugStateSaver saver(debug);
|
||||
debug.nospace() << '[' << static_cast<const void *>(wrapper.m_ptr) << ']';
|
||||
return debug;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_TRACE
|
||||
|
||||
Reference in New Issue
Block a user