qdoc: No longer prints namespace qualifier twice
authorMartin Smith <martin.smith@nokia.com>
Fri, 3 Aug 2012 10:29:40 +0000 (12:29 +0200)
committerQt by Nokia <qt-info@nokia.com>
Sun, 5 Aug 2012 23:31:19 +0000 (01:31 +0200)
enum values in the Qt namespace were being printed
as. e.g.: Qt::Qt::AlignLeft. This was due to the
presence of a collision node that was not handled
properly.

Task nr: QTBUG-26628

Change-Id: I54adaba72410b2838f0922f181846bb7e76b61d4
Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
src/tools/qdoc/cppcodemarker.cpp
src/tools/qdoc/htmlgenerator.cpp

index 166ede9..e910665 100644 (file)
@@ -433,14 +433,14 @@ QString CppCodeMarker::markedUpFullName(const Node *node, const Node *relative)
     }
 }
 
-QString CppCodeMarker::markedUpEnumValue(const QString &enumValue,
-                                         const Node *relative)
+QString CppCodeMarker::markedUpEnumValue(const QString &enumValue, const Node *relative)
 {
     const Node *node = relative->parent();
     QString fullName;
     while (node->parent()) {
         fullName.prepend(markedUpName(node));
-        if (node->parent() == relative || node->parent()->name().isEmpty())
+        if (node->parent() == relative || node->parent()->name().isEmpty() ||
+            node->parent()->isCollisionNode())
             break;
         fullName.prepend("<@op>::</@op>");
         node = node->parent();
@@ -564,7 +564,6 @@ QList<Section> CppCodeMarker::sections(const InnerNode *inner,
 
             QStack<const ClassNode *> stack;
             stack.push(classe);
-
             while (!stack.isEmpty()) {
                 const ClassNode *ancestorClass = stack.pop();
 
index 02261de..46e5d0a 100644 (file)
@@ -917,10 +917,8 @@ int HtmlGenerator::generateAtom(const Atom *atom,
         else { // (atom->string() == ATOM_LIST_VALUE)
             // ### Trenton
 
-            out() << "<tr><td class=\"topAlign\"><tt>"
-                  << protectEnc(plainCode(marker->markedUpEnumValue(atom->next()->string(),
-                                                                    relative)))
-                  << "</tt></td><td class=\"topAlign\">";
+            QString t= protectEnc(plainCode(marker->markedUpEnumValue(atom->next()->string(),relative)));
+            out() << "<tr><td class=\"topAlign\"><tt>" << t << "</tt></td><td class=\"topAlign\">";
 
             QString itemValue;
             if (relative->type() == Node::Enum) {