Remove duplicated code

Merge QtOutputFormatter::linkFormat and
PythonOutputFormatter::linkFormat to OutputFormatter::linkFormat because
these two functions were identical.

Fixes: QTCREATORBUG-23562
Change-Id: I1337b2fd66fc7d7b6742eb5e9c1a2caf1dc6b5bd
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Miklós Márton
2020-02-04 21:34:45 +01:00
parent 76d31dd93d
commit aeb7ef6b37
4 changed files with 13 additions and 23 deletions

View File

@@ -112,6 +112,16 @@ void OutputFormatter::append(const QString &text, const QTextCharFormat &format)
d->cursor.insertText(text.mid(startPos), format);
}
QTextCharFormat OutputFormatter::linkFormat(const QTextCharFormat &inputFormat, const QString &href)
{
QTextCharFormat result = inputFormat;
result.setForeground(creatorTheme()->color(Theme::TextColorLink));
result.setUnderlineStyle(QTextCharFormat::SingleUnderline);
result.setAnchor(true);
result.setAnchorHref(href);
return result;
}
void OutputFormatter::clearLastLine()
{
if (!d->cursor.atEnd())