forked from qt-creator/qt-creator
QtOutputFormatter: Fix style issues
Change-Id: I9f97b5c545639217155fb46dfd32af3b435f00a5 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -102,7 +102,7 @@ void QtOutputFormatter::appendMessage(const QString &txt, Utils::OutputFormat fo
|
||||
cursor.movePosition(QTextCursor::End);
|
||||
cursor.beginEditBlock();
|
||||
|
||||
QString deferedText;
|
||||
QString deferredText;
|
||||
|
||||
int start = 0;
|
||||
int pos = txt.indexOf(QLatin1Char('\n'));
|
||||
@@ -115,13 +115,13 @@ void QtOutputFormatter::appendMessage(const QString &txt, Utils::OutputFormat fo
|
||||
LinkResult lr = matchLine(line);
|
||||
if (!lr.href.isEmpty()) {
|
||||
// Found something && line continuation
|
||||
cursor.insertText(deferedText, charFormat(format));
|
||||
deferedText.clear();
|
||||
cursor.insertText(deferredText, charFormat(format));
|
||||
deferredText.clear();
|
||||
clearLastLine();
|
||||
appendLine(cursor, lr, line, format);
|
||||
} else {
|
||||
// Found nothing, just emit the new part
|
||||
deferedText += newPart;
|
||||
deferredText += newPart;
|
||||
}
|
||||
// Handled line continuation
|
||||
m_lastLine.clear();
|
||||
@@ -129,11 +129,11 @@ void QtOutputFormatter::appendMessage(const QString &txt, Utils::OutputFormat fo
|
||||
const QString line = txt.mid(start, pos - start + 1);
|
||||
LinkResult lr = matchLine(line);
|
||||
if (!lr.href.isEmpty()) {
|
||||
cursor.insertText(deferedText, charFormat(format));
|
||||
deferedText.clear();
|
||||
cursor.insertText(deferredText, charFormat(format));
|
||||
deferredText.clear();
|
||||
appendLine(cursor, lr, line, format);
|
||||
} else {
|
||||
deferedText += line;
|
||||
deferredText += line;
|
||||
}
|
||||
}
|
||||
start = pos + 1;
|
||||
@@ -149,29 +149,28 @@ void QtOutputFormatter::appendMessage(const QString &txt, Utils::OutputFormat fo
|
||||
LinkResult lr = matchLine(line);
|
||||
if (!lr.href.isEmpty()) {
|
||||
// Found something && line continuation
|
||||
cursor.insertText(deferedText, charFormat(format));
|
||||
deferedText.clear();
|
||||
cursor.insertText(deferredText, charFormat(format));
|
||||
deferredText.clear();
|
||||
clearLastLine();
|
||||
appendLine(cursor, lr, line, format);
|
||||
} else {
|
||||
// Found nothing, just emit the new part
|
||||
deferedText += newPart;
|
||||
deferredText += newPart;
|
||||
}
|
||||
m_lastLine = line;
|
||||
} else {
|
||||
m_lastLine = txt.mid(start);
|
||||
LinkResult lr = matchLine(m_lastLine);
|
||||
if (!lr.href.isEmpty()) {
|
||||
cursor.insertText(deferedText, charFormat(format));
|
||||
deferedText.clear();
|
||||
cursor.insertText(deferredText, charFormat(format));
|
||||
deferredText.clear();
|
||||
appendLine(cursor, lr, m_lastLine, format);
|
||||
} else {
|
||||
deferedText += m_lastLine;
|
||||
deferredText += m_lastLine;
|
||||
}
|
||||
}
|
||||
}
|
||||
cursor.insertText(deferedText, charFormat(format));
|
||||
// deferedText.clear();
|
||||
cursor.insertText(deferredText, charFormat(format));
|
||||
cursor.endEditBlock();
|
||||
}
|
||||
|
||||
|
@@ -61,11 +61,11 @@ class QTSUPPORT_EXPORT QtOutputFormatter
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QtOutputFormatter(ProjectExplorer::Project *project);
|
||||
explicit QtOutputFormatter(ProjectExplorer::Project *project);
|
||||
|
||||
virtual void appendMessage(const QString &text,
|
||||
void appendMessage(const QString &text,
|
||||
Utils::OutputFormat format);
|
||||
virtual void handleLink(const QString &href);
|
||||
void handleLink(const QString &href);
|
||||
|
||||
protected:
|
||||
void clearLastLine();
|
||||
@@ -75,8 +75,8 @@ private slots:
|
||||
|
||||
private:
|
||||
LinkResult matchLine(const QString &line) const;
|
||||
void appendLine(QTextCursor & cursor, LinkResult lr,
|
||||
const QString &line, Utils::OutputFormat);
|
||||
void appendLine(QTextCursor &cursor, LinkResult lr, const QString &line,
|
||||
Utils::OutputFormat);
|
||||
|
||||
mutable QRegExp m_qmlError;
|
||||
mutable QRegExp m_qtError;
|
||||
|
Reference in New Issue
Block a user