summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/generator.cpp
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@digia.com>2015-05-22 13:59:13 +0200
committerMartin Smith <martin.smith@digia.com>2015-06-10 12:46:53 +0000
commit9b58fe5c264cabe6912bb4fb7b045c2aecd98cb7 (patch)
tree81dc58aae68d25f9ecc966bf99ea2ce2569b9a94 /src/tools/qdoc/generator.cpp
parent0ec550c748748fcc94008bc2555482bd614251dc (diff)
qdoc: Related non-members are now linked correctly
It was harder to fix this tan you might think, but the fix cleans up the overload mechanism a lot, so if no regressions are introduced by the fix, the code will be easier to manage. The related non-members are now added to the class node's list of secondary (overload) functions. This way, they get an overload number just like overloaded member functions. Change-Id: I68d7a314b0bb5ec0fbba15dc1fd40a5b870c659d Task-number: QTBUG-46148 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Diffstat (limited to 'src/tools/qdoc/generator.cpp')
-rw-r--r--src/tools/qdoc/generator.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp
index 7b7fd45f21..4f44adc68d 100644
--- a/src/tools/qdoc/generator.cpp
+++ b/src/tools/qdoc/generator.cpp
@@ -573,7 +573,7 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir)
else if (functionNode->associatedProperty())
return fullDocumentLocation(functionNode->associatedProperty());
- else if (functionNode->overloadNumber() > 1)
+ else if (functionNode->overloadNumber() > 0)
anchorRef = QLatin1Char('#') + cleanRef(functionNode->name())
+ QLatin1Char('-') + QString::number(functionNode->overloadNumber());
else
@@ -840,9 +840,8 @@ void Generator::generateBody(const Node *node, CodeMarker *marker)
}
else if (!(*a).isEmpty() && !documentedParams.contains(*a)) {
bool needWarning = (func->status() > Node::Obsolete);
- if (func->overloadNumber() > 1) {
- FunctionNode *primaryFunc =
- func->parent()->findFunctionNode(func->name());
+ if (func->overloadNumber() > 0) {
+ FunctionNode *primaryFunc = func->parent()->findFunctionNode(func->name());
if (primaryFunc) {
foreach (const Parameter &param,
primaryFunc->parameters()) {
@@ -2021,7 +2020,7 @@ void Generator::supplementAlsoList(const Node *node, QList<Text> &alsoList)
{
if (node->type() == Node::Function) {
const FunctionNode *func = static_cast<const FunctionNode *>(node);
- if (func->overloadNumber() == 1) {
+ if (func->overloadNumber() == 0) {
QString alternateName;
const FunctionNode *alternateFunc = 0;