diff options
author | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2010-02-25 08:27:21 (GMT) |
---|---|---|
committer | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2010-02-25 08:27:21 (GMT) |
commit | 977d88856d8bbe199e293a677a7fe3d401aad4b8 (patch) | |
tree | 46fca6de3c08a7e44f1afb9c36840d91ae297270 /tools | |
parent | ad833a3bf8fe6415659c1f7b37b0cc4e3e7c8c4f (diff) | |
download | Qt-977d88856d8bbe199e293a677a7fe3d401aad4b8.zip Qt-977d88856d8bbe199e293a677a7fe3d401aad4b8.tar.gz Qt-977d88856d8bbe199e293a677a7fe3d401aad4b8.tar.bz2 |
Revert "qdoc: Finished "Inherited by" list for QML elements."
This reverts commit 83d7242271cf8196a8133de0406788135e16abbb.
Reviewed-by: Martin Smith
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qdoc3/cppcodeparser.cpp | 2 | ||||
-rw-r--r-- | tools/qdoc3/generator.cpp | 26 | ||||
-rw-r--r-- | tools/qdoc3/generator.h | 7 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 30 | ||||
-rw-r--r-- | tools/qdoc3/node.cpp | 8 | ||||
-rw-r--r-- | tools/qdoc3/node.h | 6 |
6 files changed, 35 insertions, 44 deletions
diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index d9e9c3b..021d64a 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -1034,7 +1034,7 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc, else if (command == COMMAND_QMLINHERITS) { setLink(node, Node::InheritsLink, arg); if (node->subType() == Node::QmlClass) { - QmlClassNode::addInheritedBy(arg,node); + QmlClassNode::addInheritedBy(arg,node->name()); } } else if (command == COMMAND_QMLDEFAULT) { diff --git a/tools/qdoc3/generator.cpp b/tools/qdoc3/generator.cpp index a7ab453..6a8899a 100644 --- a/tools/qdoc3/generator.cpp +++ b/tools/qdoc3/generator.cpp @@ -1186,32 +1186,6 @@ void Generator::appendSortedNames(Text& text, } } -void Generator::appendSortedNames(Text& text, - const Node* base, - const NodeList& subs, - CodeMarker *marker) -{ - NodeList::ConstIterator r; - QMap<QString,Text> classMap; - int index = 0; - - r = subs.begin(); - while (r != subs.end()) { - Text className; - appendFullName(className, (*r), base, marker); - classMap[className.toString().toLower()] = className; - ++r; - } - - QStringList classNames = classMap.keys(); - classNames.sort(); - - foreach (const QString &className, classNames) { - text << classMap[className]; - text << separator(index++, classNames.count()); - } -} - int Generator::skipAtoms(const Atom *atom, Atom::Type type) const { int skipAhead = 0; diff --git a/tools/qdoc3/generator.h b/tools/qdoc3/generator.h index 50ffb0a..44f56e2 100644 --- a/tools/qdoc3/generator.h +++ b/tools/qdoc3/generator.h @@ -169,13 +169,6 @@ class Generator const QList<RelatedClass> &classes, CodeMarker *marker); - protected: - void appendSortedNames(Text& text, - const Node* base, - const NodeList& subs, - CodeMarker *marker); - - private: QString amp; QString lt; QString gt; diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index c20f745..e767460 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -4316,16 +4316,40 @@ void HtmlGenerator::generateQmlInheritedBy(const QmlClassNode* cn, CodeMarker* marker) { if (cn) { - NodeList subs; + QStringList subs; QmlClassNode::subclasses(cn->name(),subs); if (!subs.isEmpty()) { - //subs.sort(); + subs.sort(); Text text; text << Atom::ParaLeft << "Inherited by "; - appendSortedNames(text,cn,subs,marker); + for (int i = 0; i < subs.size(); ++i) { + text << subs.at(i); + text << separator(i, subs.size()); + } text << Atom::ParaRight; generateText(text, cn, marker); } +#if 0 + if (cn->links().contains(Node::InheritsLink)) { + QPair<QString,QString> linkPair; + linkPair = cn->links()[Node::InheritsLink]; + QStringList strList(linkPair.first); + const Node* n = myTree->findNode(strList,Node::Fake); + if (n && n->subType() == Node::QmlClass) { + const QmlClassNode* qcn = static_cast<const QmlClassNode*>(n); + out() << "<p style=\"text-align: center\">"; + Text text; + text << "[Inherits "; + text << Atom(Atom::LinkNode,CodeMarker::stringForNode(qcn)); + text << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK); + text << Atom(Atom::String, linkPair.second); + text << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK); + text << "]"; + generateText(text, cn, marker); + out() << "</p>"; + } + } +#endif } } diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 5357597..4ddcfb1 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -1257,7 +1257,7 @@ bool TargetNode::isInnerNode() const #ifdef QDOC_QML bool QmlClassNode::qmlOnly = false; -QMultiMap<QString,Node*> QmlClassNode::inheritedBy; +QMultiMap<QString,QString> QmlClassNode::inheritedBy; /*! Constructs a Qml class node (i.e. a Fake node with the @@ -1294,15 +1294,15 @@ QString QmlClassNode::fileBase() const Record the fact that QML class \a base is inherited by QML class \a sub. */ -void QmlClassNode::addInheritedBy(const QString& base, Node* sub) +void QmlClassNode::addInheritedBy(const QString& base, const QString& sub) { inheritedBy.insert(base,sub); } /*! - Loads the list \a subs with the nodes of all the subclasses of \a base. + Loads the list \a subs with the names of all the subclasses of \a base. */ -void QmlClassNode::subclasses(const QString& base, NodeList& subs) +void QmlClassNode::subclasses(const QString& base, QStringList& subs) { subs.clear(); if (inheritedBy.contains(base)) diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index 3798e4e..de26025 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -383,12 +383,12 @@ class QmlClassNode : public FakeNode const ClassNode* classNode() const { return cnode; } virtual QString fileBase() const; - static void addInheritedBy(const QString& base, Node* sub); - static void subclasses(const QString& base, NodeList& subs); + static void addInheritedBy(const QString& base, const QString& sub); + static void subclasses(const QString& base, QStringList& subs); public: static bool qmlOnly; - static QMultiMap<QString,Node*> inheritedBy; + static QMultiMap<QString,QString> inheritedBy; private: const ClassNode* cnode; |