From 02de17eae61496e3b9ba78de5b8868ad94d21294 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 1 Sep 2016 09:40:15 +0200 Subject: qdoc: Don't report error for things marked \internal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change allows qdoc to avoid printing warnings about a qdoc comment, if the comment contains the \internal command. In these cases, the comment will not be used in the documentation, so there is no point reporting warnings about it. However, if the showinternal option is used, warnings about comments marked internal are printed anyway. Change-Id: Idcb329958681523c79e9f6a3a144ae26d44a6906 Reviewed-by: Topi Reiniƶ --- src/qdoc/codeparser.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/qdoc/codeparser.cpp') diff --git a/src/qdoc/codeparser.cpp b/src/qdoc/codeparser.cpp index 83d2ddc4d..c344ad763 100644 --- a/src/qdoc/codeparser.cpp +++ b/src/qdoc/codeparser.cpp @@ -353,6 +353,21 @@ void CodeParser::setLink(Node* node, Node::LinkType linkType, const QString& arg node->setLink(linkType, link, desc); } +/*! + \brief Test for whether a doc comment warrants warnings. + + Returns true if qdoc should report that it has found something + wrong with the qdoc comment in \a doc. Sometimes, qdoc should + not report the warning, for example, when the comment contains + the \c internal command, which normally means qdoc will not use + the comment in the documentation anyway, so there is no point + in reporting warnings about it. + */ +bool CodeParser::isWorthWarningAbout(const Doc &doc) +{ + return (showInternal_ || !doc.metaCommandsUsed().contains(QStringLiteral("internal"))); +} + /*! Returns \c true if the file being parsed is a .h file. */ -- cgit v1.2.3