qdoc: Restricted qdoc errors for \reimp command

qdoc no longer considers the \reimp command when the
parent C++ class has been marked \internal, because
the reimplimented functions aren't supposed to be in
the documentation at all, when the parent class is
internal.

Change-Id: I3d811ca737934f95e9078ce7b1e957890f6aaf38
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
This commit is contained in:
Martin Smith 2012-07-19 15:25:44 +02:00 committed by Qt by Nokia
parent e8e8d0e9f2
commit fb7b18c703

View File

@ -1029,15 +1029,16 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc,
} }
} }
else if (command == COMMAND_REIMP) { else if (command == COMMAND_REIMP) {
if (node->parent() && !node->parent()->isInternal()) {
if (node != 0 && node->type() == Node::Function) { if (node != 0 && node->type() == Node::Function) {
FunctionNode *func = (FunctionNode *) node; FunctionNode *func = (FunctionNode *) node;
const FunctionNode *from = func->reimplementedFrom(); const FunctionNode *from = func->reimplementedFrom();
if (from == 0) { if (from == 0) {
doc.location().warning( doc.location().warning(tr("Cannot find base function for '\\%1' in %2()")
tr("Cannot find base function for '\\%1' in %2()")
.arg(COMMAND_REIMP).arg(node->name()), .arg(COMMAND_REIMP).arg(node->name()),
tr("The function either doesn't exist in any base class " tr("The function either doesn't exist in any "
"with the same signature or it exists but isn't virtual.")); "base class with the same signature or it "
"exists but isn't virtual."));
} }
/* /*
Ideally, we would enable this check to warn whenever Ideally, we would enable this check to warn whenever
@ -1047,10 +1048,10 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc,
*/ */
else if (from->access() == Node::Private else if (from->access() == Node::Private
|| from->parent()->access() == Node::Private) { || from->parent()->access() == Node::Private) {
doc.location().warning(tr("'\\%1' in %2() should be '\\internal' because its base function is private or internal") doc.location().warning(tr("'\\%1' in %2() should be '\\internal' "
.arg(COMMAND_REIMP).arg(node->name())); "because its base function is private "
"or internal").arg(COMMAND_REIMP).arg(node->name()));
} }
func->setReimp(true); func->setReimp(true);
} }
else { else {
@ -1059,6 +1060,7 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc,
.arg(node->name())); .arg(node->name()));
} }
} }
}
else if (command == COMMAND_RELATES) { else if (command == COMMAND_RELATES) {
/* /*
Find the node that this node relates to. Find the node that this node relates to.