mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-06 09:39:55 +00:00
Qt: optimize log viewer file loading
This commit is contained in:
parent
a9ee9a69a4
commit
8ac9968096
@ -224,9 +224,8 @@ void log_viewer::show_log()
|
|||||||
m_gui_settings->SetValue(gui::fd_log_viewer, m_path_last);
|
m_gui_settings->SetValue(gui::fd_log_viewer, m_path_last);
|
||||||
|
|
||||||
QTextStream stream(&file);
|
QTextStream stream(&file);
|
||||||
QString text = stream.readAll();
|
m_full_log = stream.readAll();
|
||||||
text.replace('\0', '0');
|
m_full_log.replace('\0', '0');
|
||||||
set_text_and_keep_position(text);
|
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -252,12 +251,8 @@ void log_viewer::filter_log()
|
|||||||
{
|
{
|
||||||
if (m_full_log.isEmpty())
|
if (m_full_log.isEmpty())
|
||||||
{
|
{
|
||||||
m_full_log = m_log_text->toPlainText();
|
set_text_and_keep_position(m_full_log);
|
||||||
|
return;
|
||||||
if (m_full_log.isEmpty())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log_text->setPlainText(tr("Filtering..."));
|
m_log_text->setPlainText(tr("Filtering..."));
|
||||||
|
@ -15,7 +15,7 @@ void Highlighter::addRule(const QString &pattern, const QBrush &brush)
|
|||||||
|
|
||||||
void Highlighter::highlightBlock(const QString &text)
|
void Highlighter::highlightBlock(const QString &text)
|
||||||
{
|
{
|
||||||
for (const HighlightingRule &rule : highlightingRules)
|
for (const HighlightingRule& rule : highlightingRules)
|
||||||
{
|
{
|
||||||
QRegularExpressionMatchIterator matchIterator = rule.pattern.globalMatch(text);
|
QRegularExpressionMatchIterator matchIterator = rule.pattern.globalMatch(text);
|
||||||
while (matchIterator.hasNext())
|
while (matchIterator.hasNext())
|
||||||
@ -168,7 +168,7 @@ GlslHighlighter::GlslHighlighter(QTextDocument *parent) : Highlighter(parent)
|
|||||||
<< "r16_snorm" << "r32ui"
|
<< "r16_snorm" << "r32ui"
|
||||||
<< "r8_snorm" << "r16ui";
|
<< "r8_snorm" << "r16ui";
|
||||||
|
|
||||||
for (const QString &pattern : keywordPatterns)
|
for (const QString& pattern : keywordPatterns)
|
||||||
addRule("\\b" + pattern + "\\b", Qt::darkBlue); // normal words like: soka, nani, or gomen
|
addRule("\\b" + pattern + "\\b", Qt::darkBlue); // normal words like: soka, nani, or gomen
|
||||||
|
|
||||||
addRule("\\bGL_(?:[A-Z]|_)+\\b", Qt::darkMagenta); // constants like: GL_OMAE_WA_MOU_SHINDEIRU
|
addRule("\\bGL_(?:[A-Z]|_)+\\b", Qt::darkMagenta); // constants like: GL_OMAE_WA_MOU_SHINDEIRU
|
||||||
|
Loading…
x
Reference in New Issue
Block a user