summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/cppcodeparser.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@digia.com>2014-08-04 13:30:35 +0200
committerMartin Smith <martin.smith@digia.com>2014-08-22 18:23:50 +0200
commitaf7f944dc507734d449355ee8e09674b2993349a (patch)
treefd19c956c333de50c0766836eac5fad202b81a84 /src/tools/qdoc/cppcodeparser.cpp
parenta5570bbf9af05fa33cfcc9f167786e8d2ca1e32e (diff)
qdoc: Add new checkForCollision()
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ƶ <topi.reinio@digia.com>
Diffstat (limited to 'src/tools/qdoc/cppcodeparser.cpp')
-rw-r--r--src/tools/qdoc/cppcodeparser.cpp18
1 files changed, 18 insertions, 0 deletions
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());