summaryrefslogtreecommitdiff
path: root/src/qdoc/cppcodemarker.cpp
diff options
context:
space:
mode:
authorLuca Di Sera <luca.disera@qt.io>2022-09-06 13:50:35 +0200
committerLuca Di Sera <luca.disera@qt.io>2022-09-07 12:32:23 +0200
commita285decaf612f75229d8429891be1beef165994b (patch)
treed0cb5d9fffa4981ffcce112b52709039217fec7f /src/qdoc/cppcodemarker.cpp
parent157cb7cbcb5a8d148b25e43066b80edd71a1d1b9 (diff)
downloadqttools-a285decaf612f75229d8429891be1beef165994b.tar.gz
QDoc: Remove unfinished support for documenting javascript
The codebase for QDoc has support for commands related to documenting pure javascript codebases. Generally, given a certain QML specific command, a javascript equivalent is provided. For example, "\jstype" or "\jsmodule". Codewise, the support is bolted on by reusing the exact same code that is used for QML types. The internal structures used to represent QML elements, like `QmlPropertyNode`, were reused for javascript elements, with the sole difference of changing the metaness value, for elements where the metaness is meaningful, and the internal type tag of the node. Code that branched specifically with QML types was modified to branch for javascript types too, with mostly no other difference in the branched code itself. The support for javascript was never finalized, albeit it is supposed to work, lacking, for example, representation in the documentation. As a consequence of this it is not currently used, tested or necessary. Hence, the code supporting the documentation of javascript elements is now removed as dead code. Anything referring to javascript specific elements were removed, from the commands definitions to the categorization functions. "Node::changeType" and "FunctionNode::changeMetaness", that switched the type and metaness, respectively, of an existing node with a new one, albeit implemented in a more general fashion, are now removed as dead code, since they were used specifically to "convert" Qml nodes to "javascript nodes". References to javascript were removed in the documentation for QDoc. Do note that not all javascript related features were removed from the codebase. In particular, the "js" and "endjs" commands, to mark a codeblock as being javascript code, and their supporting code such as `JsCodeMarker`, were currently retained as, albeit no documentation exists, are currently used a couple of time in the current Qt's codebase. The remaining javascript specific code is expected to be addressed and removed in a future commit, unless the current usages are specific enough that they cannot be replaced with qml specific commands. Task-number: QTBUG-106275 Change-Id: I6a199ce97b26d6a3a645c0022e599a8654989a85 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/cppcodemarker.cpp')
-rw-r--r--src/qdoc/cppcodemarker.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/qdoc/cppcodemarker.cpp b/src/qdoc/cppcodemarker.cpp
index 9a9bf2284..3ba925018 100644
--- a/src/qdoc/cppcodemarker.cpp
+++ b/src/qdoc/cppcodemarker.cpp
@@ -78,8 +78,7 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node, const Node * /* relati
if (style == Section::Details) {
if (!node->isRelatedNonmember() && !node->isProxyNode() && !node->parent()->name().isEmpty()
- && !node->parent()->isHeader() && !node->isProperty() && !node->isQmlNode()
- && !node->isJsNode()) {
+ && !node->parent()->isHeader() && !node->isProperty() && !node->isQmlNode()) {
name.prepend(taggedNode(node->parent()) + "::");
}
}
@@ -232,17 +231,17 @@ QString CppCodeMarker::markedUpQmlItem(const Node *node, bool summary)
QString name = taggedQmlNode(node);
if (summary) {
name = linkTag(node, name);
- } else if (node->isQmlProperty() || node->isJsProperty()) {
+ } else if (node->isQmlProperty()) {
const auto *pn = static_cast<const QmlPropertyNode *>(node);
if (pn->isAttached())
name.prepend(pn->element() + QLatin1Char('.'));
}
name = "<@name>" + name + "</@name>";
QString synopsis;
- if (node->isQmlProperty() || node->isJsProperty()) {
+ if (node->isQmlProperty()) {
const auto *pn = static_cast<const QmlPropertyNode *>(node);
synopsis = name + " : " + typified(pn->dataType());
- } else if (node->isFunction(Node::QML) || node->isFunction(Node::JS)) {
+ } else if (node->isFunction(Node::QML)) {
const auto *func = static_cast<const FunctionNode *>(node);
if (!func->returnType().isEmpty())
synopsis = typified(func->returnType(), true) + name;