From 93d7ee0da371f9e15fdb0c173df53c28eab307c7 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 12 Sep 2013 15:27:38 +0200 Subject: [PATCH] qdoc: Eliminate duplicate page warnings in some cases Prevent qdoc from reporting duplicate pages for external pages with the same URL and title. Task-number: QTBUG-33462 Change-Id: Idabdb241aaa4fe105f7b3ea78229ff1ae8776ecf Reviewed-by: Jerome Pasion --- src/tools/qdoc/qdocdatabase.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp index f1a92c2eb3..a50f428d24 100644 --- a/src/tools/qdoc/qdocdatabase.cpp +++ b/src/tools/qdoc/qdocdatabase.cpp @@ -1035,7 +1035,21 @@ void QDocDatabase::resolveTargets(InnerNode* root) DocNode* node = static_cast(child); if (!node->title().isEmpty()) { QString key = Doc::canonicalTitle(node->title()); - docNodesByTitle_.insert(key, node); + QList nodes = docNodesByTitle_.values(key); + bool alreadyThere = false; + if (!nodes.empty()) { + for (int i=0; i< nodes.size(); ++i) { + if (nodes[i]->subType() == Node::ExternalPage) { + if (node->name() == nodes[i]->name()) { + alreadyThere = true; + break; + } + } + } + } + if (!alreadyThere) { + docNodesByTitle_.insert(key, node); + } } if (node->subType() == Node::Collision) { resolveTargets(node);