qdoc: Handle multiple \ingroup commands in QML types.
authorMartin Smith <martin.smith@nokia.com>
Tue, 20 Mar 2012 13:08:25 +0000 (14:08 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 20 Mar 2012 13:21:25 +0000 (14:21 +0100)
These were not handled in the QmlVisitor class.
It was believed they would appear as separate
commands in QmlVisitor, but the appear as one
\ingroup command followed by several group
identifiers.

Change-Id: If198433f7cd5095264f41346987c49ee4c30a786
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
src/tools/qdoc/qmlvisitor.cpp

index 9c934eb..956f874 100644 (file)
@@ -266,6 +266,7 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
         if (!topic.isEmpty()) {
             args = doc.metaCommandArgs(topic);
             if (topic == COMMAND_QMLCLASS) {
+                // do nothing.
             }
             else if (topic == COMMAND_QMLPROPERTY) {
                 if (node->type() == Node::QmlProperty) {
@@ -320,7 +321,6 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
                 if (node->name() == args[0])
                     doc.location().warning(tr("%1 tries to inherit itself").arg(args[0]));
                 else {
-                    qDebug() << "QML Component:" << node->name() << "inherits:" << args[0];
                     CodeParser::setLink(node, Node::InheritsLink, args[0]);
                     if (node->subType() == Node::QmlClass) {
                         QmlClassNode::addInheritedBy(args[0],node);
@@ -339,8 +339,12 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
                     qpn->setReadOnly(1);
                 }
             }
-            else if (command == COMMAND_INGROUP) {
-                tree->addToGroup(node, args[0]);
+            else if ((command == COMMAND_INGROUP) && !args.isEmpty()) {
+                QStringList::ConstIterator arg = args.begin();
+                while (arg != args.end()) {
+                    tree->addToGroup(node, *arg);
+                    ++arg;
+                }
             }
             else if (command == COMMAND_INTERNAL) {
                 node->setAccess(Node::Private);