summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-02-10 20:51:07 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2011-02-11 15:05:52 -0200
commitc4f21744c7148f7cbb593f8bfe3cdd524abd912b (patch)
tree573fcb78e7954b73ceea8cd9af9609f8d5a7f4de
parent2fa3a9485d45cfa27593848fbcee1b21ed1bfa57 (diff)
Fix bug 638 - "Documentation for phonon doesn't show class inheritance diagrams."
Reviewer: Lauro Moura <lauro.neto@openbossa.org> Renato Araújo <renato.filho@openbossa.org>
-rw-r--r--generators/qtdoc/qtdocgenerator.cpp34
1 files changed, 9 insertions, 25 deletions
diff --git a/generators/qtdoc/qtdocgenerator.cpp b/generators/qtdoc/qtdocgenerator.cpp
index 01ab2713..016090fc 100644
--- a/generators/qtdoc/qtdocgenerator.cpp
+++ b/generators/qtdoc/qtdocgenerator.cpp
@@ -811,22 +811,6 @@ QTextStream& operator<<(QTextStream& s, const QtXmlToSphinx::Table &table)
return s;
}
-static QString getClassName(const AbstractMetaClass *cppClass)
-{
- if (!cppClass)
- return QString();
-
- QString scope = cppClass->name();
- const AbstractMetaClass *context = cppClass->enclosingClass();
- while (context) {
- if (!context->isNamespace())
- scope = context->name() + "." + context->name();
- context = context->enclosingClass();
- }
-
- return scope;
-}
-
static QString getFuncName(const AbstractMetaFunction *cppFunc) {
static bool hashInitialized = false;
static QHash<QString, QString> operatorsHash;
@@ -876,7 +860,7 @@ QtDocGenerator::~QtDocGenerator()
QString QtDocGenerator::fileNameForClass(const AbstractMetaClass *cppClass) const
{
- return QString("%1.rst").arg(getClassName(cppClass));
+ return QString("%1.rst").arg(getClassTargetFullName(cppClass, false));
}
void QtDocGenerator::writeFormatedText(QTextStream& s, const Documentation& doc, const AbstractMetaClass* metaClass)
@@ -884,7 +868,7 @@ void QtDocGenerator::writeFormatedText(QTextStream& s, const Documentation& doc,
QString metaClassName;
if (metaClass)
- metaClassName = getClassName(metaClass);
+ metaClassName = getClassTargetFullName(metaClass);
if (doc.format() == Documentation::Native) {
QtXmlToSphinx x(this, doc.value(), metaClassName);
@@ -916,7 +900,7 @@ void QtDocGenerator::generateClass(QTextStream &s, const AbstractMetaClass *meta
m_docParser->fillDocumentation(const_cast<AbstractMetaClass*>(metaClass));
s << ".. module:: " << metaClass->package() << endl;
- QString className = getClassName(metaClass);
+ QString className = getClassTargetFullName(metaClass, false);
s << ".. _" << className << ":" << endl << endl;
s << className << endl;
@@ -971,9 +955,9 @@ void QtDocGenerator::writeFunctionList(QTextStream& s, const AbstractMetaClass*
QString className;
if (!func->isConstructor())
- className = getClassName(cppClass) + '.';
+ className = getClassTargetFullName(cppClass) + '.';
else if (func->implementingClass() && func->implementingClass()->enclosingClass())
- className = getClassName(func->implementingClass()->enclosingClass()) + '.';
+ className = getClassTargetFullName(func->implementingClass()->enclosingClass()) + '.';
QString funcName = getFuncName(func);
QStringList& list = func->isStatic() ? staticFunctionList : functionList;
@@ -1036,7 +1020,7 @@ void QtDocGenerator::writeEnums(QTextStream& s, const AbstractMetaClass* cppClas
static const QString section_title(".. attribute:: ");
foreach (AbstractMetaEnum *en, cppClass->enums()) {
- s << section_title << getClassName(cppClass) << "." << en->name() << endl << endl;
+ s << section_title << getClassTargetFullName(cppClass) << "." << en->name() << endl << endl;
writeFormatedText(s, en->documentation(), cppClass);
}
}
@@ -1046,7 +1030,7 @@ void QtDocGenerator::writeFields(QTextStream &s, const AbstractMetaClass *cppCla
static const QString section_title(".. attribute:: ");
foreach (AbstractMetaField *field, cppClass->fields()) {
- s << section_title << getClassName(cppClass) << "." << field->name() << endl << endl;
+ s << section_title << getClassTargetFullName(cppClass) << "." << field->name() << endl << endl;
//TODO: request for member ‘documentation’ is ambiguous
writeFormatedText(s, field->AbstractMetaAttributes::documentation(), cppClass);
}
@@ -1250,9 +1234,9 @@ void QtDocGenerator::writeFunctionSignature(QTextStream& s, const AbstractMetaCl
{
QString className;
if (!func->isConstructor())
- className = getClassName(cppClass) + '.';
+ className = getClassTargetFullName(cppClass) + '.';
else if (func->implementingClass() && func->implementingClass()->enclosingClass())
- className = getClassName(func->implementingClass()->enclosingClass()) + '.';
+ className = getClassTargetFullName(func->implementingClass()->enclosingClass()) + '.';
QString funcName = getFuncName(func);
if (!funcName.startsWith(className))