From 1637d91efd8fb389bc09bdaa960f5d9d4f9e0164 Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Fri, 19 Mar 2021 11:16:26 +0100 Subject: QDoc: Add \deprecatedsince command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As deprecated methods may stick around over a couple of versions, add a command that lets us record which version something was deprecated in. [ChangeLog][qdoc] QDoc now lets you record the version something is deprecated in with the new \deprecatedsince command. Fixes: QTBUG-58249 Change-Id: I69de350502580f446008f717462bbc1c4c251564 Reviewed-by: Topi Reiniƶ --- src/qdoc/cppcodeparser.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/qdoc/cppcodeparser.cpp') diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp index 106e5f75d..7f03f6707 100644 --- a/src/qdoc/cppcodeparser.cpp +++ b/src/qdoc/cppcodeparser.cpp @@ -522,7 +522,7 @@ void CppCodeParser::processMetaCommand(const Doc &doc, const QString &command, if (node->isFunction()) { auto *fn = static_cast(node); // The clang visitor class will have set the - // qualified name of the ovverridden function. + // qualified name of the overridden function. // If the name of the overridden function isn't // set, issue a warning. if (fn->overridesThis().isEmpty() && isWorthWarningAbout(doc)) { @@ -625,7 +625,13 @@ void CppCodeParser::processMetaCommand(const Doc &doc, const QString &command, if (node->isQmlType() || node->isJsType()) node->setAbstract(true); } else if (command == COMMAND_DEPRECATED) { - node->setStatus(Node::Obsolete); + node->setStatus(Node::Deprecated); + } else if (command == COMMAND_DEPRECATED_SINCE) { + if (!arg.isEmpty()) + node->setDeprecatedSince(arg); + else + doc.location().warning( + QStringLiteral("Missing since version for \\%1").arg(COMMAND_DEPRECATED_SINCE)); } else if (command == COMMAND_INGROUP || command == COMMAND_INPUBLICGROUP) { // Note: \ingroup and \inpublicgroup are the same (and now recognized as such). qdb_->addToGroup(arg, node); -- cgit v1.2.1