From 5f29e0324065ebb76f39b8e8fb2cecc91db150dc Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Tue, 1 Mar 2011 18:34:38 -0300 Subject: Use extra directory to also find module docs. Reviewer: Marcelo Lira Luciano Wolf --- generators/qtdoc/qtdocgenerator.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/generators/qtdoc/qtdocgenerator.cpp b/generators/qtdoc/qtdocgenerator.cpp index 04e648be5..fedb05a99 100644 --- a/generators/qtdoc/qtdocgenerator.cpp +++ b/generators/qtdoc/qtdocgenerator.cpp @@ -1412,12 +1412,20 @@ void QtDocGenerator::finishGeneration() s << "Detailed Description" << endl; s << "--------------------" << endl << endl; - Documentation moduleDoc = m_docParser->retrieveModuleDocumentation(it.key()); - if (moduleDoc.format() == Documentation::Native) { - QtXmlToSphinx x(this, moduleDoc.value(), QString(it.key()).remove(0, it.key().lastIndexOf('.') + 1)); - s << x; + // module doc is always wrong and C++istic, so go straight to the extra directory! + QFile moduleDoc(m_extraSectionDir + '/' + it.key() + ".rst"); + if (moduleDoc.open(QIODevice::ReadOnly | QIODevice::Text)) { + s << moduleDoc.readAll(); + moduleDoc.close(); } else { - s << moduleDoc.value(); + // try the normal way + Documentation moduleDoc = m_docParser->retrieveModuleDocumentation(it.key()); + if (moduleDoc.format() == Documentation::Native) { + QtXmlToSphinx x(this, moduleDoc.value(), QString(it.key()).remove(0, it.key().lastIndexOf('.') + 1)); + s << x; + } else { + s << moduleDoc.value(); + } } } } -- cgit v1.2.3