qdoc: Structure the DITA map with a root node.
authorMartin Smith <martin.smith@nokia.com>
Fri, 16 Mar 2012 08:50:39 +0000 (09:50 +0100)
committerQt by Nokia <qt-info@nokia.com>
Sat, 17 Mar 2012 00:52:12 +0000 (01:52 +0100)
Use the title from the index.html page for the
navtitle, if there is a title on the index.html
page. Otherwise use the project as the navtitle.

Task-number:  Mzilla bug - 7229
Change-Id: I25fc1f09b0bdff58c6340cec7d9d8a43d95845a2
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
src/tools/qdoc/ditaxmlgenerator.cpp

index 6b0c2dc..f19f902 100644 (file)
@@ -5900,9 +5900,15 @@ void DitaXmlGenerator::writeDitaMap(const Tree *tree)
     writeEndTag(); // </topicmeta>
 
     writeStartTag(DT_topicref);
-    xmlWriter().writeAttribute("navtitle",project);
-    if (rootPageNode)
+    if (rootPageNode) {
+        if (!rootPageNode->title().isEmpty())
+            xmlWriter().writeAttribute("navtitle",rootPageNode->title());
+        else
+            xmlWriter().writeAttribute("navtitle",project);
         xmlWriter().writeAttribute("href",fileName(rootPageNode));
+    }
+    else
+        xmlWriter().writeAttribute("navtitle",project);
 
     writeTopicrefs(pageTypeMaps[Node::OverviewPage], "overviews");
     writeTopicrefs(pageTypeMaps[Node::HowToPage], "howtos");