summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-06-30 18:10:49 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:10:06 -0300
commit1930fb468bf5b81a02a18d564be90b5737fa7242 (patch)
treef8e6173aef0beae3e87f53795c08a5472c753cd6
parent2d266c0947c72635c2a1c3550a44497f16473d91 (diff)
Implemented support to namespace on documentation.
Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org>, Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--qtdocparser.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/qtdocparser.cpp b/qtdocparser.cpp
index 6847607d..66977c61 100644
--- a/qtdocparser.cpp
+++ b/qtdocparser.cpp
@@ -53,7 +53,19 @@ void QtDocParser::fillDocumentation(AbstractMetaClass* metaClass)
if (!metaClass)
return;
+ QString scope = metaClass->name();
+ const AbstractMetaClass* context = metaClass->enclosingClass();
+ while(context) {
+ if (context->enclosingClass() == 0)
+ break;
+ context = context->enclosingClass();
+ }
+
QString filename = metaClass->qualifiedCppName().toLower().replace("::", "-");
+ // Remove namespace
+ if (context && context->isNamespace() && filename.startsWith(context->name(), Qt::CaseInsensitive)) {
+ filename = filename.remove(0, context->name().size() + 1);
+ }
QString sourceFile = documentationDataDirectory() + '/' + filename + ".xml";
if (metaClass->enclosingClass())
sourceFile.replace("::", "-");