Qt: optimize log viewer file loading

This commit is contained in:
Megamouse 2022-12-19 22:20:58 +01:00
parent a9ee9a69a4
commit 8ac9968096
2 changed files with 6 additions and 11 deletions

View File

@ -224,9 +224,8 @@ void log_viewer::show_log()
m_gui_settings->SetValue(gui::fd_log_viewer, m_path_last);
QTextStream stream(&file);
QString text = stream.readAll();
text.replace('\0', '0');
set_text_and_keep_position(text);
m_full_log = stream.readAll();
m_full_log.replace('\0', '0');
file.close();
}
else
@ -252,13 +251,9 @@ void log_viewer::filter_log()
{
if (m_full_log.isEmpty())
{
m_full_log = m_log_text->toPlainText();
if (m_full_log.isEmpty())
{
set_text_and_keep_position(m_full_log);
return;
}
}
m_log_text->setPlainText(tr("Filtering..."));