diff options
author | Paul Wicking <paul.wicking@qt.io> | 2020-05-28 08:41:53 +0200 |
---|---|---|
committer | Paul Wicking <paul.wicking@qt.io> | 2020-05-28 11:20:42 +0200 |
commit | dae508d7c54fc0db0fa1de90fc8cb4c486d64d8f (patch) | |
tree | 597787b186c050a2a96b827b9601c0586491aada /src/qdoc/xmlgenerator.cpp | |
parent | 1a1a18b86c7fb2c4213be276268830f3b1524ac7 (diff) | |
download | qttools-dae508d7c54fc0db0fa1de90fc8cb4c486d64d8f.tar.gz |
QDoc: Cleanup in xmlgenerator
* Do not const qualify return type when returning by value.
* Remove nullptr checks following nullptr check that returns
the method.
* Remove unnecessary comment that states the file's name.
Task-number: QTBUG-71176
Change-Id: I029bdb3726d60c3ff64c596854acf31dca9c7036
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/xmlgenerator.cpp')
-rw-r--r-- | src/qdoc/xmlgenerator.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/qdoc/xmlgenerator.cpp b/src/qdoc/xmlgenerator.cpp index 8b266ca18..78e3b81e0 100644 --- a/src/qdoc/xmlgenerator.cpp +++ b/src/qdoc/xmlgenerator.cpp @@ -26,10 +26,6 @@ ** ****************************************************************************/ -/* - xmlgenerator.cpp -*/ - #include "xmlgenerator.h" #include "qdocdatabase.h" @@ -316,7 +312,7 @@ QString XmlGenerator::linkForNode(const Node *node, const Node *relative) return QString(); QString fn = fileName(node); - if (node && node->parent() && (node->parent()->isQmlType() || node->parent()->isJsType()) + if (node->parent() && (node->parent()->isQmlType() || node->parent()->isJsType()) && node->parent()->isAbstract()) { if (Generator::qmlTypeContext()) { if (Generator::qmlTypeContext()->inherits(node->parent())) { @@ -346,7 +342,7 @@ QString XmlGenerator::linkForNode(const Node *node, const Node *relative) the link must go up to the parent directory and then back down into the other subdirectory. */ - if (node && relative && (node != relative)) { + if (relative && (node != relative)) { if (useOutputSubdirs() && !node->isExternalPage() && node->outputSubdirectory() != relative->outputSubdirectory()) { if (link.startsWith(QString(node->outputSubdirectory() + QLatin1Char('/')))) { @@ -419,7 +415,7 @@ QString XmlGenerator::getAutoLink(const Atom *atom, const Node *relative, const return link; } -const QPair<QString, QString> XmlGenerator::anchorForNode(const Node *node) +QPair<QString, QString> XmlGenerator::anchorForNode(const Node *node) { QPair<QString, QString> anchorPair; |