diff --git a/src/qt_gui/check_update.cpp b/src/qt_gui/check_update.cpp index 5cae6c41a..e73a66a71 100644 --- a/src/qt_gui/check_update.cpp +++ b/src/qt_gui/check_update.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -247,7 +247,7 @@ void CheckUpdate::setupUI(const QString& downloadUrl, const QString& latestDate, bool latest_isWIP = latestRev.endsWith("WIP", Qt::CaseInsensitive); if (current_isWIP && !latest_isWIP) { } else { - QTextEdit* textField = new QTextEdit(this); + QTextBrowser* textField = new QTextBrowser(this); textField->setReadOnly(true); textField->setFixedWidth(500); textField->setFixedHeight(200); @@ -349,8 +349,28 @@ void CheckUpdate::requestChangelog(const QString& currentRev, const QString& lat } // Update the text field with the changelog - QTextEdit* textField = findChild(); + QTextBrowser* textField = findChild(); if (textField) { + QRegularExpression re("\\(\\#(\\d+)\\)"); + QString newChanges; + int lastIndex = 0; + QRegularExpressionMatchIterator i = re.globalMatch(changes); + while (i.hasNext()) { + QRegularExpressionMatch match = i.next(); + newChanges += changes.mid(lastIndex, match.capturedStart() - lastIndex); + QString num = match.captured(1); + newChanges += + QString( + "(#%1)") + .arg(num); + lastIndex = match.capturedEnd(); + } + + newChanges += changes.mid(lastIndex); + changes = newChanges; + + textField->setOpenExternalLinks(true); textField->setHtml("

" + tr("Changes") + ":

" + changes); }