From 46959875cf7ddeb9bbcee883e4bfaef63992b870 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 23 May 2014 13:26:36 +0200 Subject: qdoc: Give documenter more control of linking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This update is preparation for implementing the actual task described in the bug. To implement it required converting the QML type node and the QML basic type node to be first order tree nodes instead of subtypes of the documentation node. This cleans up a lot of messy logic in some places. It was also necessary to split the getLink() function in the html output generator into two functions, one still called getLink(), which handles the \l command, and one called qetAutoLink() which is called for generating auto links. This should make qdoc run faster. The basic infrastructure was also added for parsing the string in the square brackets for the \l command. There will be a further update to complete this task. Note that some autolinks might not be generated due to this change. I haven't seen any yet, but I believe there will be some. This can be fixed later, if it is a problem. Task-number: QTBUG-39221 Change-Id: I8135229984398408205ba901b9ef95ceac74683c Reviewed-by: Topi Reiniƶ --- src/tools/qdoc/cppcodeparser.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/tools/qdoc/cppcodeparser.cpp') diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp index cda541c928a..2755bf72541 100644 --- a/src/tools/qdoc/cppcodeparser.cpp +++ b/src/tools/qdoc/cppcodeparser.cpp @@ -408,17 +408,13 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, without including the namespace qualifier. */ Node::Type type = nodeTypeMap[command]; - Node::SubType subtype = Node::NoSubType; - if (type == Node::Document) - subtype = Node::QmlClass; - QStringList paths = arg.first.split(QLatin1Char(' ')); QStringList path = paths[0].split("::"); Node *node = 0; - node = qdb_->findNodeInOpenNamespace(path, type, subtype); + node = qdb_->findNodeInOpenNamespace(path, type); if (node == 0) - node = qdb_->findNodeByNameAndType(path, type, subtype); + node = qdb_->findNodeByNameAndType(path, type); if (node == 0) { doc.location().warning(tr("Cannot find '%1' specified with '\\%2' in any header file") .arg(arg.first).arg(command)); @@ -971,14 +967,14 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc, else if (command == COMMAND_QMLINHERITS) { if (node->name() == arg) doc.location().warning(tr("%1 tries to inherit itself").arg(arg)); - else if (node->subType() == Node::QmlClass) { + else if (node->isQmlType()) { QmlClassNode *qmlClass = static_cast(node); qmlClass->setQmlBaseName(arg); QmlClassNode::addInheritedBy(arg,node); } } else if (command == COMMAND_QMLINSTANTIATES) { - if ((node->type() == Node::Document) && (node->subType() == Node::QmlClass)) { + if (node->isQmlType()) { ClassNode* classNode = qdb_->findClassNode(arg.split("::")); if (classNode) node->setClassNode(classNode); @@ -1023,9 +1019,8 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc, } } else if (command == COMMAND_QMLABSTRACT) { - if ((node->type() == Node::Document) && (node->subType() == Node::QmlClass)) { + if (node->isQmlType()) node->setAbstract(true); - } } else { processCommonMetaCommand(doc.location(),command,argLocPair,node); -- cgit v1.2.3