From 1f742095ce762074e01680d897afa4a30acd8756 Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Sun, 25 Mar 2012 20:22:52 +0200 Subject: [PATCH] qdoc: Do not write index.dita multiple times in ditamap. Change-Id: I69719237d0ab567ce2a606c96b38f6baa2a601b5 Reviewed-by: Martin Smith --- src/tools/qdoc/ditaxmlgenerator.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index a25fc0d4bb..1f0a383d25 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -5838,6 +5838,9 @@ void DitaXmlGenerator::writeDitaMap(const Tree *tree) { QString doctype; +/* + Remove #if 0 to get a flat ditamap. +*/ #if 0 beginSubPage(tree->root(),"qt.ditamap"); doctype = ""; @@ -5969,6 +5972,12 @@ void DitaXmlGenerator::writeTopicrefs(NodeMultiMap* nmm, const QString& navtitle xmlWriter().writeAttribute("navtitle",navtitle); NodeMultiMap::iterator i = nmm->begin(); while (i != nmm->end()) { + // Hardcode not writing index.dita multiple times in the tree. + // index.dita should only appear at the top of the ditamap. + if (fileName(i.value()) == "index.dita") { + i++; + continue; + } writeStartTag(DT_topicref); xmlWriter().writeAttribute("navtitle",i.key()); xmlWriter().writeAttribute("href",fileName(i.value()));