aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2
diff options
context:
space:
mode:
authorVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2019-11-07 09:54:13 +0100
committerVenugopal Shivashankar <Venugopal.Shivashankar@qt.io>2019-11-18 11:12:35 +0100
commit688176a3c35f49c7c087ca2f0e8c841e72133176 (patch)
tree04d5939c747ccd748cd14889c192f0485cfe3320 /sources/shiboken2
parent91f62b1db2bdfe9b4eaeb291f31c97c1767fa3fd (diff)
Doc: Drop PySide prefix from the RST filenames
Shiboken appends the content in these RSTs to the module index pages that it generates. In addition, - updated the snippets, extras, and additional docs passed to the Shiboken call. - moved the copy_directory command right before the shiboken call. Change-Id: I45222ba7d0798105a764d7692d466f7a2a105d77 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken2')
-rw-r--r--sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
index 339669758..de023f079 100644
--- a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
+++ b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
@@ -2193,11 +2193,19 @@ void QtDocGenerator::writeModuleDocumentation()
/* Avoid showing "Detailed Description for *every* class in toc tree */
Indentation indentation(INDENT);
+ // Store the it.key() in a QString so that it can be stripped off unwanted
+ // information when neeeded. For example, the RST files in the extras directory
+ // doesn't include the PySide# prefix in their names.
+ const QString moduleName = it.key();
+ const int lastIndex = moduleName.lastIndexOf(QLatin1Char('.'));
// Search for extra-sections
if (!m_extraSectionDir.isEmpty()) {
QDir extraSectionDir(m_extraSectionDir);
- QStringList fileList = extraSectionDir.entryList(QStringList() << (it.key() + QLatin1String("?*.rst")), QDir::Files);
+ if (!extraSectionDir.exists())
+ qCWarning(lcShiboken) << m_extraSectionDir << "doesn't exist";
+
+ QStringList fileList = extraSectionDir.entryList(QStringList() << (moduleName.mid(lastIndex + 1) + QLatin1String("?*.rst")), QDir::Files);
QStringList::iterator it2 = fileList.begin();
for (; it2 != fileList.end(); ++it2) {
QString origFileName(*it2);
@@ -2231,7 +2239,7 @@ void QtDocGenerator::writeModuleDocumentation()
s << "--------------------" << endl << endl;
// module doc is always wrong and C++istic, so go straight to the extra directory!
- QFile moduleDoc(m_extraSectionDir + QLatin1Char('/') + it.key() + QLatin1String(".rst"));
+ QFile moduleDoc(m_extraSectionDir + QLatin1Char('/') + moduleName.mid(lastIndex + 1) + QLatin1String(".rst"));
if (moduleDoc.open(QIODevice::ReadOnly | QIODevice::Text)) {
s << moduleDoc.readAll();
moduleDoc.close();