From 802aa37f7725ca3d75d1e928d845c6df534943ba Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Wed, 6 Feb 2019 10:54:42 +0100 Subject: qdoc: Add complete version string to the HTML title Typically, most developers will have a setup with multiple versions of Qt installed, such as 5.12.0 and 5.12.1. This means that there will be several versions of the same document installed. For example, when a developer tries to search for 'Item' keyword in the Qt Creator help mode, they will be presented a list of two topics to choose from; one each for 5.12.0 and 5.12.1. Unless the HTML document includes patch version info in the title, it is hard to differentiate between to two topics in the list. Task-number: QTBUG-73620 Change-Id: I183bf6476f57d65cf2bcae52289dcb4779a87caf Reviewed-by: Paul Wicking --- src/qdoc/htmlgenerator.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp index 7eeb3705c..39ac26445 100644 --- a/src/qdoc/htmlgenerator.cpp +++ b/src/qdoc/htmlgenerator.cpp @@ -1956,9 +1956,7 @@ void HtmlGenerator::generateHeader(const QString& title, if (node && !node->doc().location().isEmpty()) out() << "\n"; - QString shortVersion = qdb_->version(); - if (shortVersion.count(QChar('.')) == 2) - shortVersion.truncate(shortVersion.lastIndexOf(QChar('.'))); + QString projectVersion = qdb_->version(); //determine the rest of the element content: "title | titleSuffix version" QString titleSuffix; @@ -1987,8 +1985,8 @@ void HtmlGenerator::generateHeader(const QString& title, titleSuffix.clear(); //for pages that duplicate the version, clear the duplicate - if (title.contains(shortVersion) || titleSuffix.contains(shortVersion)) - shortVersion.clear(); + if (title.contains(projectVersion) || titleSuffix.contains(projectVersion)) + projectVersion.clear(); QString divider; if (!titleSuffix.isEmpty() && !title.isEmpty()) @@ -2000,8 +1998,8 @@ void HtmlGenerator::generateHeader(const QString& title, << divider << titleSuffix; - if (!shortVersion.isEmpty()) - out() << QLatin1Char(' ') << shortVersion; + if (!projectVersion.isEmpty()) + out() << QLatin1Char(' ') << projectVersion; out() << "\n"; -- cgit v1.2.3