From 38af447ee061932a31b654efd4cba9c713993c4a Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 29 Oct 2021 15:57:36 +0200 Subject: [PATCH] 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 --- src/plugins/coreplugin/helpitem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/helpitem.cpp b/src/plugins/coreplugin/helpitem.cpp index 50f84bbf7ab..c2cb6ac54ef 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) {