diff options
author | Martin Smith <martin.smith@qt.io> | 2019-01-22 11:54:24 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-01-30 12:42:26 +0000 |
commit | 69b9ad609a1c89760e1e3f3c409ab1e743b4310d (patch) | |
tree | 49213cab05960382b3ce32ab4085dd01716d513e | |
parent | 02527dec057355b1d59b3acceb80a80f3167b607 (diff) | |
download | qttools-69b9ad609a1c89760e1e3f3c409ab1e743b4310d.tar.gz |
Inline CodeParser::processCommonMetaCommand() in its one caller
Change-Id: Ia715d6f5685363e4ccc22172ea45e43f1da72a17
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
-rw-r--r-- | src/qdoc/codeparser.cpp | 94 | ||||
-rw-r--r-- | src/qdoc/codeparser.h | 4 | ||||
-rw-r--r-- | src/qdoc/cppcodeparser.cpp | 65 |
3 files changed, 62 insertions, 101 deletions
diff --git a/src/qdoc/codeparser.cpp b/src/qdoc/codeparser.cpp index db82bf746..48cb98c64 100644 --- a/src/qdoc/codeparser.cpp +++ b/src/qdoc/codeparser.cpp @@ -194,100 +194,6 @@ const QSet<QString>& CodeParser::commonMetaCommands() } /*! - The topic command has been processed. Now process the other - metacommands that were found. These are not the text markup - commands. - */ -void CodeParser::processCommonMetaCommand(const Location& location, - const QString& command, - const ArgLocPair& arg, - Node* node) -{ - if (command == COMMAND_DEPRECATED) { - node->setStatus(Node::Obsolete); - } - else if ((command == COMMAND_INGROUP) || (command == COMMAND_INPUBLICGROUP)) { - // Note: \ingroup and \inpublicgroup are now the same. - // Not that they were ever different. - qdb_->addToGroup(arg.first, node); - } - else if (command == COMMAND_INMODULE) { - qdb_->addToModule(arg.first,node); - } - else if (command == COMMAND_INQMLMODULE) { - qdb_->addToQmlModule(arg.first,node); - } - else if (command == COMMAND_INJSMODULE) { - qdb_->addToJsModule(arg.first, node); - } - else if (command == COMMAND_MAINCLASS) { - node->doc().location().warning(tr("'\\mainclass' is deprecated. Consider '\\ingroup mainclasses'")); - } - else if (command == COMMAND_OBSOLETE) { - node->setStatus(Node::Obsolete); - } - else if (command == COMMAND_NONREENTRANT) { - node->setThreadSafeness(Node::NonReentrant); - } - else if (command == COMMAND_PRELIMINARY) { - // \internal wins. - if (!node->isInternal()) - node->setStatus(Node::Preliminary); - } - else if (command == COMMAND_INTERNAL) { - if (!showInternal_) { - node->setAccess(Node::Private); - node->setStatus(Node::Internal); - if (node->nodeType() == Node::QmlPropertyGroup) { - const QmlPropertyGroupNode* qpgn = static_cast<const QmlPropertyGroupNode*>(node); - NodeList::ConstIterator p = qpgn->childNodes().constBegin(); - while (p != qpgn->childNodes().constEnd()) { - if ((*p)->nodeType() == Node::QmlProperty) { - (*p)->setAccess(Node::Private); - (*p)->setStatus(Node::Internal); - } - ++p; - } - } - } - } - else if (command == COMMAND_REENTRANT) { - node->setThreadSafeness(Node::Reentrant); - } - else if (command == COMMAND_SINCE) { - node->setSince(arg.first); - } - else if (command == COMMAND_WRAPPER) { - node->setWrapper(); - } - else if (command == COMMAND_PAGEKEYWORDS) { - node->addPageKeywords(arg.first); - } - else if (command == COMMAND_THREADSAFE) { - node->setThreadSafeness(Node::ThreadSafe); - } - else if (command == COMMAND_TITLE) { - if (!node->setTitle(arg.first)) - location.warning(tr("Ignored '\\%1'").arg(COMMAND_TITLE)); - else if (node->isExample()) - qdb_->addExampleNode(static_cast<ExampleNode*>(node)); - } - else if (command == COMMAND_SUBTITLE) { - if (!node->setSubtitle(arg.first)) - location.warning(tr("Ignored '\\%1'").arg(COMMAND_SUBTITLE)); - } - else if (command == COMMAND_QTVARIABLE) { - node->setQtVariable(arg.first); - if (!node->isModule() && !node->isQmlModule()) - location.warning(tr("Command '\\%1' is only meanigfule in '\\module' and '\\qmlmodule'.") - .arg(COMMAND_QTVARIABLE)); - } - else if (command == COMMAND_NOAUTOLIST) { - node->setNoAutoList(true); - } -} - -/*! \internal */ void CodeParser::extractPageLinkAndDesc(const QString& arg, diff --git a/src/qdoc/codeparser.h b/src/qdoc/codeparser.h index 39abd9dab..a6b72956e 100644 --- a/src/qdoc/codeparser.h +++ b/src/qdoc/codeparser.h @@ -76,10 +76,6 @@ public: protected: const QSet<QString>& commonMetaCommands(); - void processCommonMetaCommand(const Location& location, - const QString& command, - const ArgLocPair& arg, - Node *node); static void extractPageLinkAndDesc(const QString& arg, QString* link, QString* desc); diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp index 9c46536aa..c80ab745b 100644 --- a/src/qdoc/cppcodeparser.cpp +++ b/src/qdoc/cppcodeparser.cpp @@ -689,9 +689,68 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc, else if ((command == COMMAND_QMLABSTRACT) || (command == COMMAND_ABSTRACT)) { if (node->isQmlType() || node->isJsType()) node->setAbstract(true); - } - else { - processCommonMetaCommand(doc.location(),command,argLocPair,node); + } else if (command == COMMAND_DEPRECATED) { + node->setStatus(Node::Obsolete); + } else if (command == COMMAND_INGROUP || command == COMMAND_INPUBLICGROUP) { + // Note: \ingroup and \inpublicgroup are the same (and now recognized as such). + qdb_->addToGroup(arg, node); + } else if (command == COMMAND_INMODULE) { + qdb_->addToModule(arg,node); + } else if (command == COMMAND_INQMLMODULE) { + qdb_->addToQmlModule(arg,node); + } else if (command == COMMAND_INJSMODULE) { + qdb_->addToJsModule(arg, node); + } else if (command == COMMAND_MAINCLASS) { + node->doc().location().warning(tr("'\\mainclass' is deprecated. Consider '\\ingroup mainclasses'")); + } else if (command == COMMAND_OBSOLETE) { + node->setStatus(Node::Obsolete); + } else if (command == COMMAND_NONREENTRANT) { + node->setThreadSafeness(Node::NonReentrant); + } else if (command == COMMAND_PRELIMINARY) { + // \internal wins. + if (!node->isInternal()) + node->setStatus(Node::Preliminary); + } else if (command == COMMAND_INTERNAL) { + if (!showInternal()) { + node->setAccess(Node::Private); + node->setStatus(Node::Internal); + if (node->nodeType() == Node::QmlPropertyGroup) { + const QmlPropertyGroupNode* qpgn = static_cast<const QmlPropertyGroupNode*>(node); + NodeList::ConstIterator p = qpgn->childNodes().constBegin(); + while (p != qpgn->childNodes().constEnd()) { + if ((*p)->nodeType() == Node::QmlProperty) { + (*p)->setAccess(Node::Private); + (*p)->setStatus(Node::Internal); + } + ++p; + } + } + } + } else if (command == COMMAND_REENTRANT) { + node->setThreadSafeness(Node::Reentrant); + } else if (command == COMMAND_SINCE) { + node->setSince(arg); + } else if (command == COMMAND_WRAPPER) { + node->setWrapper(); + } else if (command == COMMAND_PAGEKEYWORDS) { + node->addPageKeywords(arg); + } else if (command == COMMAND_THREADSAFE) { + node->setThreadSafeness(Node::ThreadSafe); + } else if (command == COMMAND_TITLE) { + if (!node->setTitle(arg)) + doc.location().warning(tr("Ignored '\\%1'").arg(COMMAND_TITLE)); + else if (node->isExample()) + qdb_->addExampleNode(static_cast<ExampleNode*>(node)); + } else if (command == COMMAND_SUBTITLE) { + if (!node->setSubtitle(arg)) + doc.location().warning(tr("Ignored '\\%1'").arg(COMMAND_SUBTITLE)); + } else if (command == COMMAND_QTVARIABLE) { + node->setQtVariable(arg); + if (!node->isModule() && !node->isQmlModule()) + doc.location().warning(tr("Command '\\%1' is only meanigfule in '\\module' and '\\qmlmodule'.") + .arg(COMMAND_QTVARIABLE)); + } else if (command == COMMAND_NOAUTOLIST) { + node->setNoAutoList(true); } } |