Commit c3f24d49 authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

build: Append to textEdit directly for better performance

This is much faster than appending one line at a time.

BUG: 442739
(cherry picked from commit ec3989ff)
parent 477a1874
Pipeline #155619 passed with stage
in 5 minutes and 1 second
......@@ -1027,6 +1027,8 @@ void KateBuildView::slotReadReadyStdOut()
// the text to the end of the output
// FIXME This works for utf8 but not for all charsets
QString l = QString::fromUtf8(m_proc.readAllStandardOutput());
m_buildUi.plainTextEdit->appendPlainText(l);
l.remove(QLatin1Char('\r'));
m_stdOut += l;
......@@ -1037,13 +1039,12 @@ void KateBuildView::slotReadReadyStdOut()
break;
}
QString line = m_stdOut.mid(0, end);
QStringView line = QStringView(m_stdOut).mid(0, end);
const bool ninjaOutput = line.startsWith(NinjaPrefix);
m_ninjaBuildDetected |= ninjaOutput;
if (ninjaOutput) {
line = line.mid(NinjaPrefix.length());
}
m_buildUi.plainTextEdit->appendPlainText(line);
// qDebug() << line;
QRegularExpressionMatch match = m_newDirDetector.match(line);
......@@ -1093,7 +1094,7 @@ void KateBuildView::slotReadReadyStdErr()
}
/******************************************************************/
void KateBuildView::processLine(const QString &line)
void KateBuildView::processLine(QStringView line)
{
// qDebug() << line ;
......@@ -1101,7 +1102,7 @@ void KateBuildView::processLine(const QString &line)
QRegularExpressionMatch match = m_filenameDetector.match(line);
if (!match.hasMatch()) {
addError(QString(), QStringLiteral("0"), QString(), line);
addError(QString(), QStringLiteral("0"), QString(), line.toString());
// kDebug() << "A filename was not found in the line ";
return;
}
......
......@@ -117,7 +117,7 @@ private:
#ifdef Q_OS_WIN
QString caseFixed(const QString &path);
#endif
void processLine(const QString &);
void processLine(QStringView line);
void addError(const QString &filename, const QString &line, const QString &column, const QString &message);
bool startProcess(const QString &dir, const QString &command);
bool checkLocal(const QUrl &dir);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment