From e1f65ee2174fa54d3a1d5f40c2a3c5831ba96f1b Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 27 Feb 2019 14:15:29 +0100 Subject: qdoc: Fix duplication of nodes in index files Aggregate class maintains a QMap of child nodes that is used for searching. PageNode entries may be added in the map multiple times, both with name() and title() as the key. When returning a list of non-function children, duplicates are now removed. Task-number: QTBUG-74009 Change-Id: I7e5df359313a53fa3b5bc4f9efa6e3ac6ea11eab Reviewed-by: Martin Smith --- src/qdoc/node.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/qdoc/node.cpp b/src/qdoc/node.cpp index a4bc2abff..af559c93e 100644 --- a/src/qdoc/node.cpp +++ b/src/qdoc/node.cpp @@ -1244,12 +1244,15 @@ void Aggregate::normalizeOverloads() /*! Returns a const reference to the list of child nodes of this - aggregate that are not function nodes. + aggregate that are not function nodes. Duplicate nodes are + removed from the list. */ const NodeList &Aggregate::nonfunctionList() { - if (nonfunctionList_.isEmpty() || (nonfunctionList_.size() != nonfunctionMap_.size())) - nonfunctionList_ = nonfunctionMap_.values(); + std::list list = nonfunctionMap_.values().toStdList(); + list.sort(); + list.unique(); + nonfunctionList_ = NodeList::fromStdList(list); return nonfunctionList_; } -- cgit v1.2.1