From 793ed1bf88e8107f01b54e15fe8e39a4a6a0ca10 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 28 Nov 2012 14:34:24 +0100 Subject: qdoc: Listing QML group members across modules This is a second update, which fixes the "All QML APIs by Module" page, I think. I expect there will be more insifious places where this problem will pop up. qdoc must be dragged, kicking and screaming into the modular age. Task-number: QTBUG-28036 Change-Id: I8dd4733a2b0aac9bab3cb2066b6dbf139a8e98a6 Reviewed-by: Lars Knoll --- src/tools/qdoc/qdocindexfiles.cpp | 16 ++++++++++++---- src/tools/qdoc/qmlvisitor.cpp | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src/tools') diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp index 3a885040d0..2db5db3714 100644 --- a/src/tools/qdoc/qdocindexfiles.cpp +++ b/src/tools/qdoc/qdocindexfiles.cpp @@ -232,6 +232,10 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, subtype = Node::Module; ptype = Node::OverviewPage; } + else if (element.attribute("subtype") == "qmlmodule") { + subtype = Node::QmlModule; + ptype = Node::OverviewPage; + } else if (element.attribute("subtype") == "page") { subtype = Node::Page; ptype = Node::ArticlePage; @@ -449,11 +453,12 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, QString groupsAttr = element.attribute("groups"); if (!groupsAttr.isEmpty()) { - QStringList groupNames = groupsAttr.split(" "); + QStringList groupNames = groupsAttr.split(","); for (int i=0; ifindGroup(groupNames[i]); - if (dn) + if (dn) { dn->addMember(node); + } else { qDebug() << "NODE:" << node->name() << "GROUPS:" << groupNames; qDebug() << "DID NOT FIND GROUP:" << dn->name() << "for:" << node->name(); @@ -537,7 +542,7 @@ void QDocIndexFiles::writeMembersAttribute(QXmlStreamWriter& writer, ++i; } if (!names.isEmpty()) - writer.writeAttribute(attr, names.join(" ")); + writer.writeAttribute(attr, names.join(",")); } } @@ -749,13 +754,16 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, foreach (const Node* member, members) { names.append(member->name()); } - writer.writeAttribute("members", names.join(" ")); + writer.writeAttribute("members", names.join(",")); writeModuleName = true; } break; case Node::Module: writer.writeAttribute("subtype", "module"); break; + case Node::QmlModule: + writer.writeAttribute("subtype", "qmlmodule"); + break; case Node::Page: writer.writeAttribute("subtype", "page"); writeModuleName = true; diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp index 63a69ee0af..e0bee2e664 100644 --- a/src/tools/qdoc/qmlvisitor.cpp +++ b/src/tools/qdoc/qmlvisitor.cpp @@ -344,7 +344,7 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation, else if ((command == COMMAND_INGROUP) && !args.isEmpty()) { ArgList::ConstIterator argsIter = args.constBegin(); while (argsIter != args.constEnd()) { - QDocDatabase::qdocDB()->addToGroup(argsIter->first, node); + DocNode* dn = QDocDatabase::qdocDB()->addToGroup(argsIter->first, node); ++argsIter; } } -- cgit v1.2.3