mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-05 06:21:26 +12:00
Qt: fix weird missing space in stack log
This commit is contained in:
parent
e49679484a
commit
a9dcad629b
1 changed files with 7 additions and 4 deletions
|
@ -594,7 +594,7 @@ void log_frame::UpdateUI()
|
||||||
// Preserve capacity
|
// Preserve capacity
|
||||||
m_log_text.resize(0);
|
m_log_text.resize(0);
|
||||||
|
|
||||||
// Handle a special case in which we may need to override the previous repetition count
|
// Handle a common case in which we may need to override the previous repetition count
|
||||||
bool is_first_rep = true;
|
bool is_first_rep = true;
|
||||||
|
|
||||||
// Batch output of multiple lines if possible (optimization)
|
// Batch output of multiple lines if possible (optimization)
|
||||||
|
@ -622,10 +622,12 @@ void log_frame::UpdateUI()
|
||||||
|
|
||||||
if (is_first_rep)
|
if (is_first_rep)
|
||||||
{
|
{
|
||||||
// Override repetition count of previous UpdateUI() (special case)
|
// Overwrite existing repetition counter in our text document.
|
||||||
|
ensure(m_log_counter > 2); // Anything else is a bug
|
||||||
|
constexpr int size_of_x = 2; // " x"
|
||||||
text_cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor);
|
text_cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor);
|
||||||
text_cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor, (m_log_counter != 2 ? 1 + QString::number(m_log_counter - 1).size() : 0));
|
text_cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor, size_of_x + QString::number(m_log_counter - 1).size());
|
||||||
text_cursor.insertHtml(font_start_tag_stack % QStringLiteral(" x") % QString::number(m_log_counter) % font_end_tag);
|
text_cursor.insertHtml(font_start_tag_stack % QStringLiteral(" x") % QString::number(m_log_counter) % font_end_tag);
|
||||||
}
|
}
|
||||||
else if (m_log_counter > 1)
|
else if (m_log_counter > 1)
|
||||||
{
|
{
|
||||||
|
@ -666,6 +668,7 @@ void log_frame::UpdateUI()
|
||||||
// Confirm log level
|
// Confirm log level
|
||||||
if (packet->sev <= s_gui_listener.enabled)
|
if (packet->sev <= s_gui_listener.enabled)
|
||||||
{
|
{
|
||||||
|
// Check if we can stack this log message.
|
||||||
if (m_stack_log && m_old_log_level == packet->sev && packet->msg == m_old_log_text)
|
if (m_stack_log && m_old_log_level == packet->sev && packet->msg == m_old_log_text)
|
||||||
{
|
{
|
||||||
m_log_counter++;
|
m_log_counter++;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue