mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-10 12:45:46 +00:00
LogWidget: Preserve spaces and newlines
This commit is contained in:
parent
6388992f62
commit
d5692afd7d
@ -16,6 +16,7 @@
|
|||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
#include "Common/FileUtil.h"
|
#include "Common/FileUtil.h"
|
||||||
|
#include "Common/StringUtil.h"
|
||||||
|
|
||||||
#include "Core/ConfigManager.h"
|
#include "Core/ConfigManager.h"
|
||||||
|
|
||||||
@ -210,11 +211,12 @@ void LogWidget::Log(LogTypes::LOG_LEVELS level, const char* text)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log_queue.push(
|
std::string str(text);
|
||||||
QStringLiteral("%1 <font color='%2'>%3</font>")
|
StringPopBackIf(&str, '\n');
|
||||||
.arg(QString::fromStdString(std::string(text).substr(0, TIMESTAMP_LENGTH)),
|
m_log_queue.push(QStringLiteral("%1 <span style=\"color: %2; white-space: pre\">%3</span>")
|
||||||
QString::fromStdString(color),
|
.arg(QString::fromStdString(str.substr(0, TIMESTAMP_LENGTH)),
|
||||||
QString::fromStdString(std::string(text).substr(TIMESTAMP_LENGTH)).toHtmlEscaped()));
|
QString::fromStdString(color),
|
||||||
|
QString::fromStdString(str.substr(TIMESTAMP_LENGTH)).toHtmlEscaped()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogWidget::closeEvent(QCloseEvent*)
|
void LogWidget::closeEvent(QCloseEvent*)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user