diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2018-11-18 14:00:59 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2018-11-18 14:23:28 (GMT) |
commit | f0cc0f5da51faddd490c2cf358614b4ab70cc8ac (patch) | |
tree | d88c647365010677b4c4f6353e0e03e0daea6f33 /src/ftvhelp.cpp | |
parent | 8ff99363c2f6b3226fe5b57f38ae1d4805dca22c (diff) | |
download | Doxygen-f0cc0f5da51faddd490c2cf358614b4ab70cc8ac.zip Doxygen-f0cc0f5da51faddd490c2cf358614b4ab70cc8ac.tar.gz Doxygen-f0cc0f5da51faddd490c2cf358614b4ab70cc8ac.tar.bz2 |
Minor restructuring
Diffstat (limited to 'src/ftvhelp.cpp')
-rw-r--r-- | src/ftvhelp.cpp | 73 |
1 files changed, 25 insertions, 48 deletions
diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index a13d45f..73ac775 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -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); @@ -371,30 +392,8 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in } else if (n->def && n->def->definitionType()==Definition::TypeClass) { - if (n->def->getLanguage() == SrcLangExt_Slice) - { - ClassDef *cd = dynamic_cast<ClassDef*>(n->def); - if (cd->isInterface()) - { - t << "<span class=\"icona\"><span class=\"icon\">I</span></span>"; - } - else if (cd->isStruct()) - { - t << "<span class=\"icona\"><span class=\"icon\">S</span></span>"; - } - else if (cd->isException()) - { - t << "<span class=\"icona\"><span class=\"icon\">E</span></span>"; - } - else - { - t << "<span class=\"icona\"><span class=\"icon\">C</span></span>"; - } - } - else - { - 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 { @@ -449,30 +448,8 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in } else if (n->def && n->def->definitionType()==Definition::TypeClass) { - if (n->def->getLanguage() == SrcLangExt_Slice) - { - ClassDef *cd = dynamic_cast<ClassDef*>(n->def); - if (cd->isInterface()) - { - t << "<span class=\"icona\"><span class=\"icon\">I</span></span>"; - } - else if (cd->isStruct()) - { - t << "<span class=\"icona\"><span class=\"icon\">S</span></span>"; - } - else if (cd->isException()) - { - t << "<span class=\"icona\"><span class=\"icon\">E</span></span>"; - } - else - { - t << "<span class=\"icona\"><span class=\"icon\">C</span></span>"; - } - } - else - { - 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 { |