diff options
author | Topi Reinio <topi.reinio@qt.io> | 2018-06-22 13:30:50 +0200 |
---|---|---|
committer | Topi Reiniƶ <topi.reinio@qt.io> | 2018-06-22 12:14:43 +0000 |
commit | e06441ed6d9b8aaa7467b019be8c7b0404c8862e (patch) | |
tree | 54c20293f7c2a779dfc815674a2c32ffec159958 | |
parent | 248e4913098ae2b13f0a887c188359c0aeefac4f (diff) | |
download | qttools-e06441ed6d9b8aaa7467b019be8c7b0404c8862e.tar.gz |
qdoc: Prevent duplicated example entries in annotated list
QMultiMap where the example nodes are collected allows duplicate
(key, value) pairs. QDoc analyzes the tree multiple times and
we may end up with multiple copies of the same entry in an
annotated list for examples.
Also when listing the examples, use navigation.landingtitle as the
(module) section title, with navigation.landingpage as fallback.
This prevents html file names as section titles which look bad.
Task-number: QTBUG-69079
Change-Id: I24199137856d9775078b7780e5b52642ec5acbbc
Reviewed-by: Martin Smith <martin.smith@qt.io>
-rw-r--r-- | src/qdoc/main.cpp | 10 | ||||
-rw-r--r-- | src/qdoc/qdocdatabase.cpp | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/qdoc/main.cpp b/src/qdoc/main.cpp index 563915d49..96aeec1a5 100644 --- a/src/qdoc/main.cpp +++ b/src/qdoc/main.cpp @@ -377,10 +377,14 @@ static void processQdocconfFile(const QString &fileName) // Store the title of the index (landing) page NamespaceNode* root = qdb->primaryTreeRoot(); - if (root) + if (root) { + QString title = config.getString(CONFIG_NAVIGATION + + Config::dot + + CONFIG_LANDINGPAGE); root->tree()->setIndexTitle(config.getString(CONFIG_NAVIGATION - + Config::dot - + CONFIG_LANDINGPAGE)); + + Config::dot + + CONFIG_LANDINGTITLE, title)); + } QSet<QString> excludedDirs = QSet<QString>::fromList(config.getCanonicalPathList(CONFIG_EXCLUDEDIRS)); QSet<QString> excludedFiles = QSet<QString>::fromList(config.getCanonicalPathList(CONFIG_EXCLUDEFILES)); diff --git a/src/qdoc/qdocdatabase.cpp b/src/qdoc/qdocdatabase.cpp index 8a4b276e8..634c01a4b 100644 --- a/src/qdoc/qdocdatabase.cpp +++ b/src/qdoc/qdocdatabase.cpp @@ -1050,7 +1050,9 @@ void QDocDatabase::findAllClasses(Aggregate* node) } else if ((*c)->isExample()) { // use the module index title as key for the example map - examples_.insert((*c)->tree()->indexTitle(), *c); + QString title = (*c)->tree()->indexTitle(); + if (!examples_.contains(title, *c)) + examples_.insert(title, *c); } else if ((*c)->isAggregate()) { findAllClasses(static_cast<Aggregate*>(*c)); |