aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/coreplugin/mainwindow.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2023-06-09 13:51:36 +0200
committerEike Ziller <eike.ziller@qt.io>2023-06-12 06:10:03 +0000
commitfafd24a61629d58bc4d5adf8386c1e807cb48b67 (patch)
tree2a1fb2a9bae402c8b8e31d5b0f1e0bbe370d3902 /src/plugins/coreplugin/mainwindow.cpp
parent14d8f1573db97b38065542349598699098b1e609 (diff)
Change log: Add links to the bugreports
And prevent that the internal log viewer replaces the bug items with links if they are already within a link. Change-Id: I115fd9be59d0394a91b3bcd3157083e30d44c6b5 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/plugins/coreplugin/mainwindow.cpp')
-rw-r--r--src/plugins/coreplugin/mainwindow.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp
index c93710ff58..846b5d9dea 100644
--- a/src/plugins/coreplugin/mainwindow.cpp
+++ b/src/plugins/coreplugin/mainwindow.cpp
@@ -1465,8 +1465,10 @@ void MainWindow::changeLog()
return;
const FilePath file = versionedFiles.at(index).second;
QString contents = QString::fromUtf8(file.fileContents().value_or(QByteArray()));
- static const QRegularExpression bugexpr("(QT(CREATOR)?BUG-[0-9]+)");
- contents.replace(bugexpr, "[\\1](https://bugreports.qt.io/browse/\\1)");
+ // (?<![[\/]) == don't replace if it is preceded by "[" or "/"
+ // i.e. if it already is part of a link
+ static const QRegularExpression bugexpr(R"((?<![[\/])((QT(CREATOR)?BUG|PYSIDE)-\d+))");
+ contents.replace(bugexpr, R"([\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))