aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/qtdocparser.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-09-27 15:19:21 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-09-27 23:12:33 +0200
commita8717d612eb17c3dfaaede46c7bda34e5c20125e (patch)
treeb47cef22ddf4c85f720461c22a0d23d8dadfcbca /sources/shiboken6/ApiExtractor/qtdocparser.cpp
parentdf67bfbc7289c526d54105248e064d8846ad9ad5 (diff)
shiboken6/Documentation: Fix WebXML module documentation name
Complements 752c1161d75f8c01e2c6c6b07ba02e9a62e65b10. Task-number: QTBUG-77650 Task-number: PYSIDE-2620 Task-number: PYSIDE-1106 Change-Id: If6865f2db8ebc8fb40894603c57ec13e7b26bced Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/qtdocparser.cpp')
-rw-r--r--sources/shiboken6/ApiExtractor/qtdocparser.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/sources/shiboken6/ApiExtractor/qtdocparser.cpp b/sources/shiboken6/ApiExtractor/qtdocparser.cpp
index e10242d86..b0de9041e 100644
--- a/sources/shiboken6/ApiExtractor/qtdocparser.cpp
+++ b/sources/shiboken6/ApiExtractor/qtdocparser.cpp
@@ -425,14 +425,15 @@ Documentation QtDocParser::retrieveModuleDocumentation(const QString& name)
{
// TODO: This method of acquiring the module name supposes that the target language uses
// dots as module separators in package names. Improve this.
- QString moduleName = name;
- moduleName.remove(0, name.lastIndexOf(u'.') + 1);
- if (moduleName == u"QtQuickControls2")
- moduleName.chop(1);
- const QString prefix = documentationDataDirectory() + u'/'
- + moduleName.toLower();
+ QString completeModuleName = name;
+ if (completeModuleName.endsWith("QtQuickControls2"_L1))
+ completeModuleName.chop(1);
+ const QString moduleName = completeModuleName.sliced(name.lastIndexOf(u'.') + 1);
+ const QString lowerModuleName = moduleName.toLower();
- const QString sourceFile = prefix + u"-index.webxml"_s;
+ const QString prefix = documentationDataDirectory() + u'/'
+ + qdocModuleDir(completeModuleName) + u'/' + lowerModuleName;
+ const QString sourceFile = prefix + "-index.webxml"_L1;
if (!QFile::exists(sourceFile)) {
qCWarning(lcShibokenDoc).noquote().nospace()
<< "Can't find qdoc file for module " << name << ", tried: "
@@ -455,7 +456,7 @@ Documentation QtDocParser::retrieveModuleDocumentation(const QString& name)
}
// If a QML module info file exists, insert a link to the Qt docs.
- const QFileInfo qmlModuleFi(prefix + u"-qmlmodule.webxml"_s);
+ const QFileInfo qmlModuleFi(prefix + "-qmlmodule.webxml"_L1);
if (qmlModuleFi.isFile()) {
QString docString = doc.detailed();
const int pos = docString.lastIndexOf(u"</description>");