summaryrefslogtreecommitdiff
path: root/src/qdoc/codeparser.h
diff options
context:
space:
mode:
authorLuca Di Sera <luca.disera@qt.io>2023-03-07 13:05:43 +0100
committerLuca Di Sera <luca.disera@qt.io>2023-03-07 13:46:29 +0000
commitdc834493f634416021a2d70c044fffb88efd06da (patch)
tree3d3a49856f79f762ac8bd46ea06d501246629c0e /src/qdoc/codeparser.h
parent571743a268bb404b88ed59232236b47c3a51d992 (diff)
downloadqttools-dc834493f634416021a2d70c044fffb88efd06da.tar.gz
QDoc: Remove `CodeParser::m_currentFile`
`CodeParser`, the base class for parsers of input source file in QDoc, exposed an internal member that stored the path of the file that was currently being parser by an instance of `CodeParser`. The member was set when a new file was being parsed, and required to be handled by all downstream parsers, both in setting and in clearing it at the correct point. Nonetheless, the member is generally unrequired and was indeed not used, as the scope and usages of the path of a parsed file is well-defined and limited during parsing. The presence of the member is a source of bugs. Indeed, not all child classes where correctly handling the lifetime of the member. Further, it generally adds maintenance cost to the child classes and hinders the creation of new derived classes as it increases the mental load and implicit knowledge that is required to implement a `CodeParser`. Hence, the member and all references to it were removed in `CodeParser` and its child classes; to simplify the codebase, remove unnecessary state, avoid the additional classes of bugs that would exist if the member was ever read and as the member represented dead code. `CodeParser::currentFile`, a getter for `m_currentFile`, was removed as a consequence of the member removal. Change-Id: If5b5538d038a073d8288a644fe39d3dddc1d89c8 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/codeparser.h')
-rw-r--r--src/qdoc/codeparser.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/qdoc/codeparser.h b/src/qdoc/codeparser.h
index 6579daedc..76d9daf10 100644
--- a/src/qdoc/codeparser.h
+++ b/src/qdoc/codeparser.h
@@ -33,7 +33,6 @@ public:
return nullptr;
}
- [[nodiscard]] const QString &currentFile() const { return m_currentFile; }
[[nodiscard]] const QString &moduleHeader() const { return m_moduleHeader; }
void setModuleHeader(const QString &t) { m_moduleHeader = t; }
void checkModuleInclusion(Node *n);
@@ -51,7 +50,6 @@ protected:
static void extractPageLinkAndDesc(QStringView arg, QString *link, QString *desc);
static bool showInternal() { return s_showInternal; }
QString m_moduleHeader {};
- QString m_currentFile {};
QDocDatabase *m_qdb {};
private: