diff options
author | Martin Smith <martin.smith@qt.io> | 2019-07-02 13:49:02 +0200 |
---|---|---|
committer | Martin Smith <martin.smith@qt.io> | 2019-07-04 15:01:12 +0200 |
commit | 41fab09dc14cad4a688fffd2d9572648e74a31a9 (patch) | |
tree | 08f973138c822723a3cdd749b603fc624ec7608c | |
parent | e0d5c6f2b5147ce793a07d862d93d66837f4a925 (diff) | |
download | qttools-41fab09dc14cad4a688fffd2d9572648e74a31a9.tar.gz |
qdoc: Ensure that doc for header file nodes is written
This update fixes a regression caused by the introduction of the
docMustBeGenerated() function. The doc for header file nodes was
not being generated because docMustBeGenerated() returned false
for the header file nodes.
Change-Id: I8bafd9e2ae96f41c8e7592403e3d9722797e5c24
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
-rw-r--r-- | src/qdoc/node.cpp | 23 | ||||
-rw-r--r-- | src/qdoc/node.h | 1 |
2 files changed, 21 insertions, 3 deletions
diff --git a/src/qdoc/node.cpp b/src/qdoc/node.cpp index 5081f4370..c1388f726 100644 --- a/src/qdoc/node.cpp +++ b/src/qdoc/node.cpp @@ -1901,11 +1901,28 @@ HeaderNode::HeaderNode(Aggregate* parent, const QString& name) : Aggregate(Heade Aggregate::addIncludeFile(name); } +/*! + Returns true if this header file node is not private and + contains at least one public child node with documentation. + */ bool HeaderNode::docMustBeGenerated() const { - if (!hasDoc() || isInternal() || isDontDocument()) - return false; - return true; + if (hasDoc() && !isInternal() && !isPrivate()) + return true; + return (hasDocumentedChildren() ? true : false); +} + +/*! + Returns true if this header file node contains at least one + child that has documentation and is not private or internal. + */ +bool HeaderNode::hasDocumentedChildren() const +{ + foreach (Node *n, children_) { + if (n->hasDoc() && !n->isPrivate() && !n->isInternal()) + return true; + } + return false; } /*! diff --git a/src/qdoc/node.h b/src/qdoc/node.h index 5d5a90ab0..6deb9f8c0 100644 --- a/src/qdoc/node.h +++ b/src/qdoc/node.h @@ -660,6 +660,7 @@ public: bool setTitle(const QString& title) override { title_ = title; return true; } bool setSubtitle(const QString &subtitle) override { subtitle_ = subtitle; return true; } QString nameForLists() const override { return title(); } + bool hasDocumentedChildren() const; private: QString title_; |