summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/cppcodeparser.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@nokia.com>2012-05-09 15:23:30 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-09 17:52:48 +0200
commit4e9dc8b49d97f1955875c727dbcdbcbb20999428 (patch)
tree7afb5081fb6f810f5e0fad71d4bc192838a1e90f /src/tools/qdoc/cppcodeparser.cpp
parent4ab7d53431c8e5091e1836eeaf876bc4ab8e4ecc (diff)
qdoc: Fixed a qdoc error problem
When an example was missing, qdoc printed an error message without specifying the location of the error. Now it includes the file path and line number of the \example command where the error can be fixed. Change-Id: Ib75ffc467c0f266ed3939b8aa4b24800ec5eb92e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
Diffstat (limited to 'src/tools/qdoc/cppcodeparser.cpp')
-rw-r--r--src/tools/qdoc/cppcodeparser.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp
index 6f117734d5..3518881a87 100644
--- a/src/tools/qdoc/cppcodeparser.cpp
+++ b/src/tools/qdoc/cppcodeparser.cpp
@@ -617,7 +617,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
else if (QRegExp("[A-Za-z_][A-Za-z0-9_]+").exactMatch(arg.first)) {
func = new FunctionNode(tree_->root(), arg.first);
func->setAccess(Node::Public);
- func->setLocation(doc.location());
+ func->setLocation(arg.second);
func->setMetaness(FunctionNode::MacroWithoutParams);
}
else {
@@ -689,6 +689,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
else if (command == COMMAND_EXAMPLE) {
if (Config::generateExamples) {
ExampleNode* en = new ExampleNode(tree_->root(), arg.first);
+ en->setLocation(arg.second);
createExampleFileNodes(en);
return en;
}
@@ -749,6 +750,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
fn = new DitaMapNode(tree_->root(), args[0]);
else
fn = new FakeNode(tree_->root(), args[0], Node::Page, ptype);
+ fn->setLocation(arg.second);
if (ncn) {
ncn->addCollision(fn);
}
@@ -777,7 +779,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
*/
NameCollisionNode* ncn = tree_->checkForCollision(names[0]);
QmlClassNode* qcn = new QmlClassNode(tree_->root(), names[0], classNode);
- qcn->setLocation(location());
+ qcn->setLocation(arg.second);
if (ncn)
ncn->addCollision(qcn);
return qcn;
@@ -2491,8 +2493,8 @@ void CppCodeParser::createExampleFileNodes(FakeNode *fake)
proFileName,
userFriendlyFilePath);
if (fullPath.isEmpty()) {
- fake->doc().location().warning(tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName));
- fake->doc().location().warning(tr("EXAMPLE PATH DOES NOT EXIST: %1").arg(examplePath));
+ fake->location().warning(tr("Cannot find file '%1' or '%2'").arg(tmp).arg(proFileName));
+ fake->location().warning(tr(" EXAMPLE PATH DOES NOT EXIST: %1").arg(examplePath));
return;
}
}