summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2019-02-06 10:54:42 +0100
committerVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2019-02-11 15:24:26 +0000
commit802aa37f7725ca3d75d1e928d845c6df534943ba (patch)
treefec64a7168eec40abfb7e69873dd1716a550597a
parent536c58c55641f2b93c95aa38d2893385f412786d (diff)
downloadqttools-802aa37f7725ca3d75d1e928d845c6df534943ba.tar.gz
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 <paul.wicking@qt.io>
-rw-r--r--src/qdoc/htmlgenerator.cpp12
1 files 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() << "<!-- " << node->doc().location().fileName() << " -->\n";
- QString shortVersion = qdb_->version();
- if (shortVersion.count(QChar('.')) == 2)
- shortVersion.truncate(shortVersion.lastIndexOf(QChar('.')));
+ QString projectVersion = qdb_->version();
//determine the rest of the <title> 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() << "</title>\n";