qdoc: Don't include internal items in annotated lists
authorMartin Smith <martin.smith@digia.com>
Thu, 29 Nov 2012 14:12:56 +0000 (15:12 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 29 Nov 2012 19:20:01 +0000 (20:20 +0100)
Now things that are marked internal oe whose parent
is marked internal won't appear in annotated lists.

Task-number: QTBUG-28274
Change-Id: I14ea96e223640cad45e7e4249a3e1fc0642bd9c3
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
src/tools/qdoc/ditaxmlgenerator.cpp
src/tools/qdoc/htmlgenerator.cpp

index b5d52bb..f912c3b 100644 (file)
@@ -2720,6 +2720,15 @@ void DitaXmlGenerator::generateAnnotatedList(const Node* relative,
 {
     if (nodes.isEmpty())
         return;
+    bool allInternal = true;
+    foreach (const Node* node, nodes) {
+        if (!node->isInternal() && node->status() != Node::Obsolete) {
+            allInternal = false;
+        }
+    }
+    if (allInternal)
+        return;
+
     writeStartTag(DT_table);
     xmlWriter().writeAttribute("outputclass","annotated");
     writeStartTag(DT_tgroup);
@@ -2727,7 +2736,7 @@ void DitaXmlGenerator::generateAnnotatedList(const Node* relative,
     writeStartTag(DT_tbody);
 
     foreach (const Node* node, nodes) {
-        if (node->status() == Node::Obsolete)
+        if (node->isInternal() || node->status() == Node::Obsolete)
             continue;
 
         writeStartTag(DT_row);
index ddc3649..1a8425b 100644 (file)
@@ -2212,10 +2212,18 @@ void HtmlGenerator::generateAnnotatedList(const Node *relative,
                                           CodeMarker *marker,
                                           const NodeList& nodes)
 {
+    bool allInternal = true;
+    foreach (const Node* node, nodes) {
+        if (!node->isInternal() && node->status() != Node::Obsolete) {
+            allInternal = false;
+        }
+    }
+    if (allInternal)
+        return;
     out() << "<table class=\"annotated\">\n";
     int row = 0;
     foreach (const Node* node, nodes) {
-        if (node->status() == Node::Obsolete)
+        if (node->isInternal() || node->status() == Node::Obsolete)
             continue;
 
         if (++row % 2 == 1)