From 35215a0f5f31c4bcca245e3f45b5ea02f4dcfc6b Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 3 Aug 2012 12:29:40 +0200 Subject: [PATCH] qdoc: No longer prints namespace qualifier twice 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 --- src/tools/qdoc/cppcodemarker.cpp | 7 +++---- src/tools/qdoc/htmlgenerator.cpp | 6 ++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp index 166ede994a..e910665d37 100644 --- a/src/tools/qdoc/cppcodemarker.cpp +++ b/src/tools/qdoc/cppcodemarker.cpp @@ -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>::"); node = node->parent(); @@ -564,7 +564,6 @@ QList
CppCodeMarker::sections(const InnerNode *inner, QStack stack; stack.push(classe); - while (!stack.isEmpty()) { const ClassNode *ancestorClass = stack.pop(); diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 02261de63c..46e5d0a4b5 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -917,10 +917,8 @@ int HtmlGenerator::generateAtom(const Atom *atom, else { // (atom->string() == ATOM_LIST_VALUE) // ### Trenton - out() << "" - << protectEnc(plainCode(marker->markedUpEnumValue(atom->next()->string(), - relative))) - << ""; + QString t= protectEnc(plainCode(marker->markedUpEnumValue(atom->next()->string(),relative))); + out() << "" << t << ""; QString itemValue; if (relative->type() == Node::Enum) {