aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/coreplugin/mainwindow.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2022-11-28 15:42:40 +0200
committerOrgad Shaneh <orgad.shaneh@audiocodes.com>2022-11-28 17:29:19 +0200
commit157f2bcd3929ea07cdd14c3930cef2313fc470ae (patch)
treef9a5a7bb8d5acf1ff702d498380659488b41b362 /src/plugins/coreplugin/mainwindow.cpp
parent8e5c84e3ddc77d049904aabba05d8ff6ef098c6b (diff)
parentd852ec53a14e64f6993929130e95b5581cfaa3a4 (diff)
Merge remote-tracking branch 'origin/9.0'
Diffstat (limited to 'src/plugins/coreplugin/mainwindow.cpp')
-rw-r--r--src/plugins/coreplugin/mainwindow.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp
index fb241498c8..576490f8ec 100644
--- a/src/plugins/coreplugin/mainwindow.cpp
+++ b/src/plugins/coreplugin/mainwindow.cpp
@@ -11,6 +11,7 @@
#include "externaltoolmanager.h"
#include "fancytabwidget.h"
#include "generalsettings.h"
+#include "helpmanager.h"
#include "icore.h"
#include "idocumentfactory.h"
#include "jsexpander.h"
@@ -1510,8 +1511,17 @@ void MainWindow::changeLog()
return;
const FilePath file = versionedFiles.at(index).second;
QString contents = QString::fromUtf8(file.fileContents().value_or(QByteArray()));
- contents.replace(QRegularExpression("(QT(CREATOR)?BUG-[0-9]+)"),
- "[\\1](https://bugreports.qt.io/browse/\\1)");
+ static const QRegularExpression bugexpr("(QT(CREATOR)?BUG-[0-9]+)");
+ contents.replace(bugexpr, "[\\1](https://bugreports.qt.io/browse/\\1)");
+ static const QRegularExpression docexpr("https://doc[.]qt[.]io/qtcreator/([.a-zA-Z/_-]*)");
+ QList<QRegularExpressionMatch> matches;
+ for (const QRegularExpressionMatch &m : docexpr.globalMatch(contents))
+ matches.append(m);
+ Utils::reverseForeach(matches, [&contents](const QRegularExpressionMatch &match) {
+ const QString qthelpUrl = "qthelp://org.qt-project.qtcreator/doc/" + match.captured(1);
+ if (!HelpManager::fileData(qthelpUrl).isEmpty())
+ contents.replace(match.capturedStart(), match.capturedLength(), qthelpUrl);
+ });
textEdit->setMarkdown(contents);
};
connect(versionCombo, &QComboBox::currentIndexChanged, textEdit, showLog);