From f7631b2b2dfea8bd42569d4751eb29d5c50229f3 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 12 May 2021 23:42:14 +0200 Subject: [PATCH] Fixing a problem with log output in log window --- src/lay/lay/layLogViewerDialog.cc | 13 ++++++------- src/lay/lay/layLogViewerDialog.h | 1 - 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lay/lay/layLogViewerDialog.cc b/src/lay/lay/layLogViewerDialog.cc index fbc175204..c5e3abe33 100644 --- a/src/lay/lay/layLogViewerDialog.cc +++ b/src/lay/lay/layLogViewerDialog.cc @@ -41,7 +41,7 @@ namespace lay // LogReceiver implementation LogReceiver::LogReceiver (LogFile *file, int verbosity, void (LogFile::*method)(const std::string &, bool)) - : mp_file (file), m_method (method), m_continued (false), m_verbosity (verbosity) + : mp_file (file), m_method (method), m_verbosity (verbosity) { // .. nothing yet .. } @@ -64,7 +64,9 @@ LogReceiver::puts (const char *s) } if (*s == '\n') { - endl (); + QMutexLocker locker (&m_lock); + (mp_file->*m_method) (m_text, true); + m_text.clear (); ++s; } @@ -78,9 +80,8 @@ LogReceiver::endl () { if (tl::verbosity () >= m_verbosity) { QMutexLocker locker (&m_lock); - (mp_file->*m_method) (m_text, m_continued); + (mp_file->*m_method) (m_text, false); m_text.clear (); - m_continued = true; } } @@ -99,9 +100,7 @@ LogReceiver::end () void LogReceiver::begin () { - QMutexLocker locker (&m_lock); - m_continued = false; - m_text.clear (); + // .. nothing yet .. } // ----------------------------------------------------------------- diff --git a/src/lay/lay/layLogViewerDialog.h b/src/lay/lay/layLogViewerDialog.h index 4f6725fe8..a449c7c08 100644 --- a/src/lay/lay/layLogViewerDialog.h +++ b/src/lay/lay/layLogViewerDialog.h @@ -96,7 +96,6 @@ private: LogFile *mp_file; void (LogFile::*m_method)(const std::string &, bool); std::string m_text; - bool m_continued; int m_verbosity; QMutex m_lock; };