diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-03-01 18:34:38 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-03-01 18:39:54 -0300 |
commit | 5f29e0324065ebb76f39b8e8fb2cecc91db150dc (patch) | |
tree | 80de5a263696ad525b28b7df5eb404bf8b77064d /generators/qtdoc/qtdocgenerator.cpp | |
parent | 66bd499c3b5abd332ca804a55857705d34eb0a4a (diff) |
Use extra directory to also find module docs.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'generators/qtdoc/qtdocgenerator.cpp')
-rw-r--r-- | generators/qtdoc/qtdocgenerator.cpp | 18 |
1 files 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(); + } } } } |