diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2022-11-28 15:42:40 +0200 |
---|---|---|
committer | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2022-11-28 17:29:19 +0200 |
commit | 157f2bcd3929ea07cdd14c3930cef2313fc470ae (patch) | |
tree | f9a5a7bb8d5acf1ff702d498380659488b41b362 /src/plugins/coreplugin/mainwindow.cpp | |
parent | 8e5c84e3ddc77d049904aabba05d8ff6ef098c6b (diff) | |
parent | d852ec53a14e64f6993929130e95b5581cfaa3a4 (diff) |
Merge remote-tracking branch 'origin/9.0'
Change-Id: I231d35f492713f317773b79478b5f7fb97a4fe50
Diffstat (limited to 'src/plugins/coreplugin/mainwindow.cpp')
-rw-r--r-- | src/plugins/coreplugin/mainwindow.cpp | 14 |
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); |