diff options
author | Martin Smith <martin.smith@digia.com> | 2012-11-28 14:34:24 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-28 16:21:57 +0100 |
commit | 793ed1bf88e8107f01b54e15fe8e39a4a6a0ca10 (patch) | |
tree | 05f08af53d8573a528cf106ae61b34e8def543f3 | |
parent | 5e59215ac649190a5b86f9af283d0cf41b88b3bf (diff) |
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 <lars.knoll@digia.com>
-rw-r--r-- | src/tools/qdoc/qdocindexfiles.cpp | 16 | ||||
-rw-r--r-- | src/tools/qdoc/qmlvisitor.cpp | 2 |
2 files changed, 13 insertions, 5 deletions
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; i<groupNames.size(); ++i) { DocNode* dn = qdb_->findGroup(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; } } |