From 1dcb7e5550910c69c3728672231ea8578324422d Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 19 Nov 2020 12:49:29 +0100 Subject: [PATCH] Help: Register at least one set of documentation per major Qt version The default configuration only registers documentation files only once, from the highest registered Qt version. This made sense within the Qt 5 series, since Qt documentation for the higher version included all items from the lower versions. With Qt 6 this changes - some API was removed in Qt 6. To make sure that documentation of all Qt 5 API is still available, we have to register the newest available documentation for Qt 5 and Qt 6, not only of Qt 6 (the overall newest available documentation). Expands 3dfa18818240006d1458f8f9104b4b8c336a60e0 Change-Id: I8b2984b0be11dcc823ef4a206800c84887b632ca Reviewed-by: Leena Miettinen Reviewed-by: Jarek Kobus --- src/plugins/qtsupport/qtversionmanager.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index 289affee6b7..20030a46ff3 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -502,14 +502,18 @@ static QList> documentationFiles(BaseQtVersion *v) static QStringList documentationFiles(const QList &vs, bool highestOnly = false) { - QSet includedFileNames; + // if highestOnly is true, register each file only once per major Qt version, even if + // multiple minor or patch releases of that major version are installed + QHash> includedFileNames; // major Qt version -> names QSet filePaths; const QList versions = highestOnly ? QtVersionManager::sortVersions(vs) : vs; for (BaseQtVersion *v : versions) { + const int majorVersion = v->qtVersion().majorVersion; + QSet &majorVersionFileNames = includedFileNames[majorVersion]; for (const std::pair &file : documentationFiles(v)) { - if (!highestOnly || !includedFileNames.contains(file.second)) { + if (!highestOnly || !majorVersionFileNames.contains(file.second)) { filePaths.insert(file.first + file.second); - includedFileNames.insert(file.second); + majorVersionFileNames.insert(file.second); } } }