aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2021-10-29 15:57:36 +0200
committerEike Ziller <eike.ziller@qt.io>2021-10-29 15:07:48 +0000
commit38af447ee061932a31b654efd4cba9c713993c4a (patch)
tree7fde6c964f2726bb43e2f09ad8df7c80867bf8aa
parent4ad8890b885b88a2b4fd670076c4d77f20708590 (diff)
Fix context help for e.g. CMake
CMake documentation links do not have Qt's version style. So, if our try to find "the highest version" fails, we still need to provide the link to open. Amends 128c7dfbefb71523c064c0c221797d4f35a42213 Fixes: QTCREATORBUG-26455 Change-Id: I3e7588cac5d4ef8ee912b3f5511e63da0b8a0f52 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
-rw-r--r--src/plugins/coreplugin/helpitem.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/coreplugin/helpitem.cpp b/src/plugins/coreplugin/helpitem.cpp
index 50f84bbf7a..c2cb6ac54e 100644
--- a/src/plugins/coreplugin/helpitem.cpp
+++ b/src/plugins/coreplugin/helpitem.cpp
@@ -298,7 +298,8 @@ static const HelpItem::Links getBestLink(const HelpItem::Links &links)
// documentation, that we only return the Qt5 link even though the Qt5 and Qt4 URLs look
// different.
QVersionNumber highestVersion;
- HelpItem::Link bestLink;
+ // Default to first link if version extraction failed, possibly because it is not a Qt doc link
+ HelpItem::Link bestLink = links.front();
for (const HelpItem::Link &link : links) {
const QVersionNumber version = extractVersion(link.second).second;
if (version > highestVersion) {