summaryrefslogtreecommitdiffstats
path: root/src/ftvhelp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ftvhelp.cpp')
-rw-r--r--src/ftvhelp.cpp57
1 files changed, 49 insertions, 8 deletions
diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp
index 8c46fd5..ea57eb7 100644
--- a/src/ftvhelp.cpp
+++ b/src/ftvhelp.cpp
@@ -35,6 +35,7 @@
#include "docparser.h"
#include "htmldocvisitor.h"
#include "filedef.h"
+#include "classdef.h"
#include "util.h"
#include "resourcemgr.h"
@@ -331,6 +332,27 @@ static void generateBriefDoc(FTextStream &t,Definition *def)
}
}
+static char compoundIcon(ClassDef *cd)
+{
+ char icon='C';
+ if (cd->getLanguage() == SrcLangExt_Slice)
+ {
+ if (cd->compoundType()==ClassDef::Interface)
+ {
+ icon='I';
+ }
+ else if (cd->compoundType()==ClassDef::Struct)
+ {
+ icon='S';
+ }
+ else if (cd->compoundType()==ClassDef::Exception)
+ {
+ icon='E';
+ }
+ }
+ return icon;
+}
+
void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,int maxLevel,int &index)
{
QListIterator<FTVNode> nli(nl);
@@ -359,11 +381,19 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in
}
else if (n->def && n->def->definitionType()==Definition::TypeNamespace)
{
- t << "<span class=\"icona\"><span class=\"icon\">N</span></span>";
+ if (n->def->getLanguage() == SrcLangExt_Slice)
+ {
+ t << "<span class=\"icona\"><span class=\"icon\">M</span></span>";
+ }
+ else
+ {
+ t << "<span class=\"icona\"><span class=\"icon\">N</span></span>";
+ }
}
else if (n->def && n->def->definitionType()==Definition::TypeClass)
{
- t << "<span class=\"icona\"><span class=\"icon\">C</span></span>";
+ char icon=compoundIcon(dynamic_cast<ClassDef*>(n->def));
+ t << "<span class=\"icona\"><span class=\"icon\">" << icon << "</span></span>";
}
else
{
@@ -407,11 +437,19 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in
}
else if (n->def && n->def->definitionType()==Definition::TypeNamespace)
{
- t << "<span class=\"icona\"><span class=\"icon\">N</span></span>";
+ if (n->def->getLanguage() == SrcLangExt_Slice)
+ {
+ t << "<span class=\"icona\"><span class=\"icon\">M</span></span>";
+ }
+ else
+ {
+ t << "<span class=\"icona\"><span class=\"icon\">N</span></span>";
+ }
}
else if (n->def && n->def->definitionType()==Definition::TypeClass)
{
- t << "<span class=\"icona\"><span class=\"icon\">C</span></span>";
+ char icon=compoundIcon(dynamic_cast<ClassDef*>(n->def));
+ t << "<span class=\"icona\"><span class=\"icon\">" << icon << "</span></span>";
}
else
{
@@ -790,10 +828,13 @@ void FTVHelp::generateTreeViewInline(FTextStream &t)
}
//printf("preferred depth=%d\n",preferredDepth);
- t << "<table class=\"directory\">\n";
- int index=0;
- generateTree(t,m_indentNodes[0],0,preferredDepth,index);
- t << "</table>\n";
+ if (m_indentNodes[0].count())
+ {
+ t << "<table class=\"directory\">\n";
+ int index=0;
+ generateTree(t,m_indentNodes[0],0,preferredDepth,index);
+ t << "</table>\n";
+ }
t << "</div><!-- directory -->\n";
}