From e06441ed6d9b8aaa7467b019be8c7b0404c8862e Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 22 Jun 2018 13:30:50 +0200 Subject: 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 --- src/qdoc/main.cpp | 10 +++++++--- 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 excludedDirs = QSet::fromList(config.getCanonicalPathList(CONFIG_EXCLUDEDIRS)); QSet excludedFiles = QSet::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(*c)); -- cgit v1.2.1