summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@nokia.com>2012-07-19 15:25:44 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-20 09:13:00 +0200
commitfb7b18c7031582c2a7a45d61da169641ce70db21 (patch)
tree6b17df60091edc09c6cff9d7713135cf7eb563dc
parente8e8d0e9f2fa7aaf3607d772753031e794538564 (diff)
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>
-rw-r--r--src/tools/qdoc/cppcodeparser.cpp54
1 files changed, 28 insertions, 26 deletions
diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp
index 5fcbc3e365..7fc2c14fe4 100644
--- a/src/tools/qdoc/cppcodeparser.cpp
+++ b/src/tools/qdoc/cppcodeparser.cpp
@@ -1029,34 +1029,36 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc,
}
}
else if (command == COMMAND_REIMP) {
- if (node != 0 && node->type() == Node::Function) {
- FunctionNode *func = (FunctionNode *) node;
- const FunctionNode *from = func->reimplementedFrom();
- if (from == 0) {
- doc.location().warning(
- tr("Cannot find base function for '\\%1' in %2()")
- .arg(COMMAND_REIMP).arg(node->name()),
- tr("The function either doesn't exist in any base class "
- "with the same signature or it exists but isn't virtual."));
+ if (node->parent() && !node->parent()->isInternal()) {
+ if (node != 0 && node->type() == Node::Function) {
+ FunctionNode *func = (FunctionNode *) node;
+ const FunctionNode *from = func->reimplementedFrom();
+ if (from == 0) {
+ doc.location().warning(tr("Cannot find base function for '\\%1' in %2()")
+ .arg(COMMAND_REIMP).arg(node->name()),
+ tr("The function either doesn't exist in any "
+ "base class with the same signature or it "
+ "exists but isn't virtual."));
+ }
+ /*
+ Ideally, we would enable this check to warn whenever
+ \reimp is used incorrectly, and only make the node
+ internal if the function is a reimplementation of
+ another function in a base class.
+ */
+ else if (from->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").arg(COMMAND_REIMP).arg(node->name()));
+ }
+ func->setReimp(true);
}
- /*
- Ideally, we would enable this check to warn whenever
- \reimp is used incorrectly, and only make the node
- internal if the function is a reimplementation of
- another function in a base class.
- */
- else if (from->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")
- .arg(COMMAND_REIMP).arg(node->name()));
+ else {
+ doc.location().warning(tr("Ignored '\\%1' in %2")
+ .arg(COMMAND_REIMP)
+ .arg(node->name()));
}
-
- func->setReimp(true);
- }
- else {
- doc.location().warning(tr("Ignored '\\%1' in %2")
- .arg(COMMAND_REIMP)
- .arg(node->name()));
}
}
else if (command == COMMAND_RELATES) {