summaryrefslogtreecommitdiffstats
path: root/src/ftvhelp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ftvhelp.cpp')
-rw-r--r--src/ftvhelp.cpp60
1 files changed, 50 insertions, 10 deletions
diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp
index cee39f2..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"
@@ -171,11 +172,10 @@ void FTVHelp::decContentsDepth()
/*! Add a list item to the contents file.
* \param isDir TRUE if the item is a directory, FALSE if it is a text
- * \param name The name of the item.
+ * \param name the name of the item.
* \param ref the URL of to the item.
* \param file the file containing the definition of the item
* \param anchor the anchor within the file.
- * \param name the name of the item.
* \param separateIndex put the entries in a separate index file
* \param addToNavIndex add this entry to the quick navigation index
* \param def Definition corresponding to this entry
@@ -332,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);
@@ -360,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
{
@@ -408,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
{
@@ -791,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";
}