From a351d1834a01d13a64f38fe970d33e2a9059c54a Mon Sep 17 00:00:00 2001 From: comp500 Date: Wed, 9 Aug 2023 20:48:02 +0100 Subject: [PATCH] Allow empty lines in log output Preserving empty lines in the game log ensures that crash reports and debugging information has necessary whitespace - the previous behaviour made crash reports hard to read. Signed-off-by: comp500 --- launcher/LoggedProcess.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/launcher/LoggedProcess.cpp b/launcher/LoggedProcess.cpp index 6978777e1..40c47d376 100644 --- a/launcher/LoggedProcess.cpp +++ b/launcher/LoggedProcess.cpp @@ -66,13 +66,12 @@ QStringList LoggedProcess::reprocess(const QByteArray& data, QTextDecoder& decod } #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) - auto lines = str.remove(QChar::CarriageReturn).split(QChar::LineFeed, QString::SkipEmptyParts); + auto lines = str.remove(QChar::CarriageReturn).split(QChar::LineFeed); #else - auto lines = str.remove(QChar::CarriageReturn).split(QChar::LineFeed, Qt::SkipEmptyParts); + auto lines = str.remove(QChar::CarriageReturn).split(QChar::LineFeed); #endif - if (!str.endsWith(QChar::LineFeed)) - m_leftover_line = lines.takeLast(); + m_leftover_line = lines.takeLast(); return lines; }