summaryrefslogtreecommitdiff
path: root/src/qdoc/qdoc/docparser.h
diff options
context:
space:
mode:
authorPaul Wicking <paul.wicking@qt.io>2023-04-23 11:40:45 +0200
committerPaul Wicking <paul.wicking@qt.io>2023-04-28 11:03:56 +0200
commitd52ced27496fe495376ddd817dd2d1475870588d (patch)
tree043f12cfda6e502fd1e32a8e977fc26edf6db61e /src/qdoc/qdoc/docparser.h
parentacae7fc8f30a4a1eabe6a8439e6f8143b4458847 (diff)
downloadqttools-d52ced27496fe495376ddd817dd2d1475870588d.tar.gz
QDoc: Extract DocParser::insertKeyword from insertTarget
Recent refactoring of `DocParser::insertTarget` exposed that the method is responsible for the handling of two separate concepts in QDoc, the commands `\target` and `\keyword`, respectively. Handling of the latter command was added to the method in question by extending it's signature with a boolean parameter, whose value was significant in deciding which code path to follow. However, this API design is no longer considered appropriate for QDoc, as discussed in review of the previous refactoring. This patch extracts the code responsible for inserting keywords into their related data structure from `DocParser::insertTarget`, and adds this code to a new member method, `DocParser::insertKeyword`. The signature of the former method is updated and the relevant call sites are updated to call the correct method. The new method is documented as part of its introduction to the code base. Given that the two methods have striking similarities, documentation is added to `DocParser::insertTarget` in its new form. Fixes: QTBUG-113126 Change-Id: Id29bc655c15b6e12726100eb1f33adbf97487236 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/qdoc/docparser.h')
-rw-r--r--src/qdoc/qdoc/docparser.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qdoc/qdoc/docparser.h b/src/qdoc/qdoc/docparser.h
index bed6608f8..4b5d75160 100644
--- a/src/qdoc/qdoc/docparser.h
+++ b/src/qdoc/qdoc/docparser.h
@@ -46,7 +46,8 @@ public:
private:
Location &location();
QString detailsUnknownCommand(const QSet<QString> &metaCommandSet, const QString &str);
- void insertTarget(const QString &target, bool keyword);
+ void insertTarget(const QString &target);
+ void insertKeyword(const QString &keyword);
void include(const QString &fileName, const QString &identifier, const QStringList &parameters);
void startFormat(const QString &format, int cmd);
bool openCommand(int cmd);