From af7f944dc507734d449355ee8e09674b2993349a Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Mon, 4 Aug 2014 13:30:35 +0200 Subject: qdoc: Add new checkForCollision() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit But don't use it yet. qdoc will check for name collisions within a module, once we decide what collisions to look for and what to do about them. This change puts a rewritten checkForCollision() function back in, but doesn't use it yet. Change-Id: I41f9275c3ca29f228268ccf7cb2d99bbe0ce557c Task-number: QTBUG-40506 Reviewed-by: Topi Reiniƶ --- src/tools/qdoc/cppcodeparser.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/tools/qdoc/cppcodeparser.cpp') diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp index be061dbd62..b6de29e57c 100644 --- a/src/tools/qdoc/cppcodeparser.cpp +++ b/src/tools/qdoc/cppcodeparser.cpp @@ -497,6 +497,15 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, ptype = Node::DitaMapPage; } +#if 0 + const Node* n = qdb_->checkForCollision(args[0]); + if (n) { + QString other = n->doc().location().fileName(); + doc.location().warning(tr("Name/title collision detected: '%1' in '\\%2'") + .arg(args[0]).arg(command), + tr("Also used here: %1").arg(other)); + } +#endif DocNode* dn = 0; if (ptype == Node::DitaMapPage) dn = new DitaMapNode(qdb_->primaryTreeRoot(), args[0]); @@ -534,6 +543,15 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, classNode = qdb_->findClassNode(names[1].split("::")); } +#if 0 + const Node* n = qdb_->checkForCollision(names[0]); + if (n) { + QString other = n->doc().location().fileName(); + doc.location().warning(tr("Name/title collision detected: '%1' in '\\%2'") + .arg(names[0]).arg(command), + tr("Also used here: %1").arg(other)); + } +#endif QmlClassNode* qcn = new QmlClassNode(qdb_->primaryTreeRoot(), names[0]); qcn->setClassNode(classNode); qcn->setLocation(doc.startLocation()); -- cgit v1.2.3