aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-08-24 19:05:18 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-08-24 19:05:18 -0300
commit8beba81378eb52d72864ca5adc1ba5f8e8a816cb (patch)
tree03ee4db3a046ae03645164042e0159b33a7f9069
parent59777bbd55a87043e6d8783d619036701e3b5387 (diff)
fixed links to classes inside namespaces
-rw-r--r--docgenerator.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/docgenerator.cpp b/docgenerator.cpp
index ebba37b70..9b21ae145 100644
--- a/docgenerator.cpp
+++ b/docgenerator.cpp
@@ -484,12 +484,18 @@ void QtXmlToSphinx::handleLinkTag(QXmlStreamReader& reader)
if (l_type == "function" && !m_context.isEmpty()) {
l_linktag = " :meth:`";
QStringList rawlinklist = l_linkref.split(".");
- if (rawlinklist.size() == 1 || rawlinklist[0] == m_context)
- l_linkref.prepend("~" + m_context + '.');
+ if (rawlinklist.size() == 1 || rawlinklist.first() == m_context)
+ l_linkref.prepend('~' + m_context + '.');
} else if (l_type == "function" && m_context.isEmpty()) {
l_linktag = " :func:`";
} else if (l_type == "class") {
l_linktag = " :class:`";
+ QStringList rawlinklist = l_linkref.split(".");
+ QStringList splitedContext = m_context.split(".");
+ if (rawlinklist.size() == 1 || rawlinklist.first() == splitedContext.last()) {
+ splitedContext.removeLast();
+ l_linkref.prepend('~' + splitedContext.join(".") + '.');
+ }
} else if (l_type == "enum") {
l_linktag = " :attr:`";
} else if (l_type == "page" && l_linkref == m_generator->moduleName()) {
@@ -1221,6 +1227,8 @@ void DocGenerator::writeFunctionSignature(QTextStream& s, const AbstractMetaClas
{
if (!func->isConstructor())
s << getClassName(cppClass) << '.';
+ else if (func->implementingClass() && func->implementingClass()->enclosingClass())
+ s << func->implementingClass()->enclosingClass()->name() << '.';
s << getFuncName(func) << "(" << parseArgDocStyle(cppClass, func) << ")";
}