diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-11-10 05:10:58 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-11-10 05:10:58 +0100 |
commit | a2ac9c5a3ace39975060a4f9d6660a467934c300 (patch) | |
tree | 08bd13bda48bb551dab4d056c0ccf2cce3682cef /logic | |
parent | 551e1011467eeaaadb610ee81e6b015ed3907ea3 (diff) | |
download | MultiMC-a2ac9c5a3ace39975060a4f9d6660a467934c300.tar MultiMC-a2ac9c5a3ace39975060a4f9d6660a467934c300.tar.gz MultiMC-a2ac9c5a3ace39975060a4f9d6660a467934c300.tar.lz MultiMC-a2ac9c5a3ace39975060a4f9d6660a467934c300.tar.xz MultiMC-a2ac9c5a3ace39975060a4f9d6660a467934c300.zip |
Fix coloring and processing of console output
* Removing \r
* Adding missing break statements for coloring
Diffstat (limited to 'logic')
-rw-r--r-- | logic/MinecraftProcess.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/logic/MinecraftProcess.cpp b/logic/MinecraftProcess.cpp index c9738176..b9be8d05 100644 --- a/logic/MinecraftProcess.cpp +++ b/logic/MinecraftProcess.cpp @@ -177,8 +177,8 @@ MessageLevel::Enum MinecraftProcess::guessLevel(const QString &line, MessageLeve } if (line.contains("overwriting existing")) return MessageLevel::Fatal; - if (line.contains("Exception in thread") || line.contains(" at ")) - return MessageLevel::Fatal; + if (line.contains("Exception in thread") || line.contains(QRegularExpression("\\s+at "))) + return MessageLevel::Error; return level; } @@ -237,6 +237,7 @@ void MinecraftProcess::on_stdErr() QByteArray data = readAllStandardError(); QString str = m_err_leftover + QString::fromLocal8Bit(data); + str.remove('\r'); QStringList lines = str.split("\n"); m_err_leftover = lines.takeLast(); @@ -248,6 +249,7 @@ void MinecraftProcess::on_stdOut() QByteArray data = readAllStandardOutput(); QString str = m_out_leftover + QString::fromLocal8Bit(data); + str.remove('\r'); QStringList lines = str.split("\n"); m_out_leftover = lines.takeLast(); @@ -259,6 +261,7 @@ void MinecraftProcess::on_prepost_stdErr() QByteArray data = m_prepostlaunchprocess.readAllStandardError(); QString str = m_err_leftover + QString::fromLocal8Bit(data); + str.remove('\r'); QStringList lines = str.split("\n"); m_err_leftover = lines.takeLast(); @@ -270,6 +273,7 @@ void MinecraftProcess::on_prepost_stdOut() QByteArray data = m_prepostlaunchprocess.readAllStandardOutput(); QString str = m_out_leftover + QString::fromLocal8Bit(data); + str.remove('\r'); QStringList lines = str.split("\n"); m_out_leftover = lines.takeLast(); |