Qt: optimize log viewer file loading
This commit is contained in:
@@ -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..."));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user