forked from qt-creator/qt-creator
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 128c7dfbef
Fixes: QTCREATORBUG-26455
Change-Id: I3e7588cac5d4ef8ee912b3f5511e63da0b8a0f52
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -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
|
// documentation, that we only return the Qt5 link even though the Qt5 and Qt4 URLs look
|
||||||
// different.
|
// different.
|
||||||
QVersionNumber highestVersion;
|
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) {
|
for (const HelpItem::Link &link : links) {
|
||||||
const QVersionNumber version = extractVersion(link.second).second;
|
const QVersionNumber version = extractVersion(link.second).second;
|
||||||
if (version > highestVersion) {
|
if (version > highestVersion) {
|
||||||
|
Reference in New Issue
Block a user