summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2019-02-27 14:15:29 +0100
committerTopi Reiniƶ <topi.reinio@qt.io>2019-02-27 13:30:18 +0000
commite1f65ee2174fa54d3a1d5f40c2a3c5831ba96f1b (patch)
treec324d173c8697155106edf5ccafe02f302037740
parentbfb970a5ae603f42b73870eb88fe486cf5315a46 (diff)
downloadqttools-e1f65ee2174fa54d3a1d5f40c2a3c5831ba96f1b.tar.gz
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 <martin.smith@qt.io>
-rw-r--r--src/qdoc/node.cpp9
1 files 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<Node*> list = nonfunctionMap_.values().toStdList();
+ list.sort();
+ list.unique();
+ nonfunctionList_ = NodeList::fromStdList(list);
return nonfunctionList_;
}