diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2021-01-06 10:27:01 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2021-01-22 20:45:18 (GMT) |
commit | 0aa907761f5f29032b01ea2d8373bbc6c53f5e7c (patch) | |
tree | c8d577474b29a4a4e8a03dddfd74d48a3e39aca4 /src | |
parent | 532f1f394f28e0358cfa763737148565397a65c7 (diff) | |
download | Doxygen-0aa907761f5f29032b01ea2d8373bbc6c53f5e7c.zip Doxygen-0aa907761f5f29032b01ea2d8373bbc6c53f5e7c.tar.gz Doxygen-0aa907761f5f29032b01ea2d8373bbc6c53f5e7c.tar.bz2 |
Refactoring: modernize LayoutNavEntry and LayoutDocEntry lists
Diffstat (limited to 'src')
-rw-r--r-- | src/classdef.cpp | 81 | ||||
-rw-r--r-- | src/dirdef.cpp | 12 | ||||
-rw-r--r-- | src/filedef.cpp | 47 | ||||
-rw-r--r-- | src/groupdef.cpp | 37 | ||||
-rw-r--r-- | src/htmlgen.cpp | 25 | ||||
-rw-r--r-- | src/index.cpp | 52 | ||||
-rw-r--r-- | src/layout.cpp | 19 | ||||
-rw-r--r-- | src/layout.h | 25 | ||||
-rw-r--r-- | src/namespacedef.cpp | 47 |
9 files changed, 133 insertions, 212 deletions
diff --git a/src/classdef.cpp b/src/classdef.cpp index 3b0390f..a04fe0a 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -2047,21 +2047,18 @@ void ClassDefImpl::writeSummaryLinks(OutputList &ol) const { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::Class)); - LayoutDocEntry *lde; bool first=TRUE; SrcLangExt lang = getLanguage(); if (lang!=SrcLangExt_VHDL) { - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class)) { if (lde->kind()==LayoutDocEntry::ClassNestedClasses && m_impl->innerClasses.declVisible() ) { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); ol.writeSummaryLink(0,"nested-classes",ls->title(lang),first); first=FALSE; } @@ -2075,7 +2072,7 @@ void ClassDefImpl::writeSummaryLinks(OutputList &ol) const } else if (lde->kind()== LayoutDocEntry::MemberDecl) { - LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get(); MemberList * ml = getMemberList(lmd->type); if (ml && ml->declVisible()) { @@ -2155,10 +2152,7 @@ void ClassDefImpl::writeTagFile(FTextStream &tagFile) } } } - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::Class)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class)) { switch (lde->kind()) { @@ -2179,7 +2173,7 @@ void ClassDefImpl::writeTagFile(FTextStream &tagFile) break; case LayoutDocEntry::MemberDecl: { - LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get(); MemberList * ml = getMemberList(lmd->type); if (ml) { @@ -2210,9 +2204,6 @@ void ClassDefImpl::writeInlineDocumentation(OutputList &ol) const ol.addIndexItem(name(),0); //printf("ClassDefImpl::writeInlineDocumentation(%s)\n",name().data()); - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::Class)); - LayoutDocEntry *lde; // part 1: anchor and title QCString s = compoundTypeString()+" "+name(); @@ -2255,7 +2246,7 @@ void ClassDefImpl::writeInlineDocumentation(OutputList &ol) const SrcLangExt lang=getLanguage(); // part 2: the header and detailed description - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class)) { switch (lde->kind()) { @@ -2278,7 +2269,7 @@ void ClassDefImpl::writeInlineDocumentation(OutputList &ol) const break; case LayoutDocEntry::MemberDecl: { - LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get(); if (!isSimple) writeMemberDeclarations(ol,lmd->type,lmd->title(lang),lmd->subtitle(lang),TRUE); } break; @@ -2293,7 +2284,7 @@ void ClassDefImpl::writeInlineDocumentation(OutputList &ol) const break; case LayoutDocEntry::MemberDef: { - LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde; + const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get(); if (isSimple) { writeSimpleMemberDocumentation(ol,lmd->type); @@ -2532,10 +2523,7 @@ void ClassDefImpl::writeDocumentationContents(OutputList &ol,const QCString & /* SrcLangExt lang = getLanguage(); - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::Class)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class)) { switch (lde->kind()) { @@ -2569,13 +2557,13 @@ void ClassDefImpl::writeDocumentationContents(OutputList &ol,const QCString & /* break; case LayoutDocEntry::MemberDecl: { - LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get(); writeMemberDeclarations(ol,lmd->type,lmd->title(lang),lmd->subtitle(lang)); } break; case LayoutDocEntry::ClassNestedClasses: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeNestedClasses(ol,ls->title(lang)); } break; @@ -2584,7 +2572,7 @@ void ClassDefImpl::writeDocumentationContents(OutputList &ol,const QCString & /* break; case LayoutDocEntry::DetailedDesc: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeDetailedDescription(ol,pageType,exampleFlag,ls->title(lang)); } break; @@ -2596,7 +2584,7 @@ void ClassDefImpl::writeDocumentationContents(OutputList &ol,const QCString & /* break; case LayoutDocEntry::MemberDef: { - LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde; + const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get(); writeMemberDocumentation(ol,lmd->type,lmd->title(lang)); } break; @@ -3280,14 +3268,11 @@ void ClassDefImpl::writeDeclaration(OutputList &ol,const MemberDef *md,bool inGr mg->writePlainDeclarations(ol,this,0,0,0,inheritedFrom,inheritId); } - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::Class)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class)) { if (lde->kind()==LayoutDocEntry::MemberDecl) { - LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get(); writePlainMemberDeclaration(ol,lmd->type,inGroup,inheritedFrom,inheritId); } } @@ -4300,14 +4285,11 @@ int ClassDefImpl::countMemberDeclarations(MemberListType lt,const ClassDef *inhe void ClassDefImpl::setAnonymousEnumType() { - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::Class)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class)) { if (lde->kind()==LayoutDocEntry::MemberDecl) { - LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get(); MemberList * ml = getMemberList(lmd->type); if (ml) { @@ -4376,14 +4358,11 @@ void ClassDefImpl::getTitleForMemberListType(MemberListType type, QCString &title,QCString &subtitle) const { SrcLangExt lang = getLanguage(); - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::Class)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class)) { if (lde->kind()==LayoutDocEntry::MemberDecl) { - LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get(); if (lmd->type==type) { title = lmd->title(lang); @@ -4399,22 +4378,15 @@ void ClassDefImpl::getTitleForMemberListType(MemberListType type, int ClassDefImpl::countAdditionalInheritedMembers() const { int totalCount=0; - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::Class)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class)) { if (lde->kind()==LayoutDocEntry::MemberDecl) { - LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get(); if (lmd->type!=MemberListType_friends) // friendship is not inherited { - //MemberList *ml = getMemberList(lmd->type); - //if (ml==0 || ml->numDecMembers()==0) - //{ - QPtrDict<void> visited(17); - totalCount+=countInheritedDecMembers(lmd->type,this,TRUE,FALSE,&visited); - //} + QPtrDict<void> visited(17); + totalCount+=countInheritedDecMembers(lmd->type,this,TRUE,FALSE,&visited); } } } @@ -4425,14 +4397,11 @@ int ClassDefImpl::countAdditionalInheritedMembers() const void ClassDefImpl::writeAdditionalInheritedMembers(OutputList &ol) const { //printf("**** writeAdditionalInheritedMembers()\n"); - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::Class)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class)) { if (lde->kind()==LayoutDocEntry::MemberDecl) { - LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get(); if (lmd->type!=MemberListType_friends) { QPtrDict<void> visited(17); diff --git a/src/dirdef.cpp b/src/dirdef.cpp index b13b757..73ba4f3 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -468,10 +468,7 @@ void DirDefImpl::writeTagFile(FTextStream &tagFile) tagFile << " <name>" << convertToXML(displayName()) << "</name>" << endl; tagFile << " <path>" << convertToXML(name()) << "</path>" << endl; tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>" << endl; - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::Directory)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Directory)) { switch (lde->kind()) { @@ -536,10 +533,7 @@ void DirDefImpl::writeDocumentation(OutputList &ol) //---------------------------------------- start flexible part ------------------------------- SrcLangExt lang = getLanguage(); - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::Directory)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Directory)) { switch (lde->kind()) { @@ -563,7 +557,7 @@ void DirDefImpl::writeDocumentation(OutputList &ol) break; case LayoutDocEntry::DetailedDesc: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeDetailedDescription(ol,ls->title(lang)); } break; diff --git a/src/filedef.cpp b/src/filedef.cpp index 2fb2af7..aa091fa 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -345,10 +345,7 @@ void FileDefImpl::writeTagFile(FTextStream &tagFile) } } } - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::File)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::File)) { switch (lde->kind()) { @@ -385,7 +382,7 @@ void FileDefImpl::writeTagFile(FTextStream &tagFile) break; case LayoutDocEntry::MemberDecl: { - LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get(); MemberList * ml = getMemberList(lmd->type); if (ml) { @@ -756,51 +753,48 @@ void FileDefImpl::writeSummaryLinks(OutputList &ol) const { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::File)); - LayoutDocEntry *lde; bool first=TRUE; SrcLangExt lang=getLanguage(); - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::File)) { if (lde->kind()==LayoutDocEntry::FileClasses && m_classes.declVisible()) { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); QCString label = "nested-classes"; ol.writeSummaryLink(0,label,ls->title(lang),first); first=FALSE; } else if (lde->kind()==LayoutDocEntry::FileInterfaces && m_interfaces.declVisible()) { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); QCString label = "interfaces"; ol.writeSummaryLink(0,label,ls->title(lang),first); first=FALSE; } else if (lde->kind()==LayoutDocEntry::FileStructs && m_structs.declVisible()) { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); QCString label = "structs"; ol.writeSummaryLink(0,label,ls->title(lang),first); first=FALSE; } else if (lde->kind()==LayoutDocEntry::FileExceptions && m_exceptions.declVisible()) { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); QCString label = "exceptions"; ol.writeSummaryLink(0,label,ls->title(lang),first); first=FALSE; } else if (lde->kind()==LayoutDocEntry::FileNamespaces && m_namespaces.declVisible()) { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); QCString label = "namespaces"; ol.writeSummaryLink(0,label,ls->title(lang),first); first=FALSE; } else if (lde->kind()==LayoutDocEntry::MemberDecl) { - LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get(); MemberList * ml = getMemberList(lmd->type); if (ml && ml->declVisible()) { @@ -894,10 +888,7 @@ void FileDefImpl::writeDocumentation(OutputList &ol) //---------------------------------------- start flexible part ------------------------------- SrcLangExt lang = getLanguage(); - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::File)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::File)) { switch (lde->kind()) { @@ -921,37 +912,37 @@ void FileDefImpl::writeDocumentation(OutputList &ol) break; case LayoutDocEntry::FileClasses: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeClassDeclarations(ol,ls->title(lang),m_classes); } break; case LayoutDocEntry::FileInterfaces: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeClassDeclarations(ol,ls->title(lang),m_interfaces); } break; case LayoutDocEntry::FileStructs: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeClassDeclarations(ol,ls->title(lang),m_structs); } break; case LayoutDocEntry::FileExceptions: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeClassDeclarations(ol,ls->title(lang),m_exceptions); } break; case LayoutDocEntry::FileNamespaces: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeNamespaceDeclarations(ol,ls->title(lang),false); } break; case LayoutDocEntry::FileConstantGroups: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeNamespaceDeclarations(ol,ls->title(lang),true); } break; @@ -960,7 +951,7 @@ void FileDefImpl::writeDocumentation(OutputList &ol) break; case LayoutDocEntry::MemberDecl: { - LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get(); writeMemberDeclarations(ol,lmd->type,lmd->title(lang)); } break; @@ -969,7 +960,7 @@ void FileDefImpl::writeDocumentation(OutputList &ol) break; case LayoutDocEntry::DetailedDesc: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeDetailedDescription(ol,ls->title(lang)); } break; @@ -981,7 +972,7 @@ void FileDefImpl::writeDocumentation(OutputList &ol) break; case LayoutDocEntry::MemberDef: { - LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde; + const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get(); writeMemberDocumentation(ol,lmd->type,lmd->title(lang)); } break; diff --git a/src/groupdef.cpp b/src/groupdef.cpp index d8526d9..c7c1202 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -603,10 +603,7 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile) tagFile << " <name>" << convertToXML(name()) << "</name>" << endl; tagFile << " <title>" << convertToXML(m_title) << "</title>" << endl; tagFile << " <filename>" << convertToXML(getOutputFileBase()) << Doxygen::htmlFileExtension << "</filename>" << endl; - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::Group)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Group)) { switch (lde->kind()) { @@ -686,7 +683,7 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile) break; case LayoutDocEntry::MemberDecl: { - LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get(); MemberList * ml = getMemberList(lmd->type); if (ml) { @@ -1029,12 +1026,9 @@ void GroupDefImpl::writeSummaryLinks(OutputList &ol) const { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::Group)); - LayoutDocEntry *lde; bool first=TRUE; SrcLangExt lang = getLanguage(); - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Group)) { if ((lde->kind()==LayoutDocEntry::GroupClasses && m_classes.declVisible()) || (lde->kind()==LayoutDocEntry::GroupNamespaces && m_namespaces.declVisible()) || @@ -1043,7 +1037,7 @@ void GroupDefImpl::writeSummaryLinks(OutputList &ol) const (lde->kind()==LayoutDocEntry::GroupDirs && !m_dirList.empty()) ) { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); QCString label = lde->kind()==LayoutDocEntry::GroupClasses ? "nested-classes" : lde->kind()==LayoutDocEntry::GroupNamespaces ? "namespaces" : lde->kind()==LayoutDocEntry::GroupFiles ? "files" : @@ -1054,7 +1048,7 @@ void GroupDefImpl::writeSummaryLinks(OutputList &ol) const } else if (lde->kind()==LayoutDocEntry::MemberDecl) { - LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get(); MemberList * ml = getMemberList(lmd->type); if (ml && ml->declVisible()) { @@ -1117,10 +1111,7 @@ void GroupDefImpl::writeDocumentation(OutputList &ol) //---------------------------------------- start flexible part ------------------------------- SrcLangExt lang=getLanguage(); - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::Group)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Group)) { switch (lde->kind()) { @@ -1132,7 +1123,7 @@ void GroupDefImpl::writeDocumentation(OutputList &ol) break; case LayoutDocEntry::GroupClasses: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeClasses(ol,ls->title(lang)); } break; @@ -1143,7 +1134,7 @@ void GroupDefImpl::writeDocumentation(OutputList &ol) break; case LayoutDocEntry::GroupNamespaces: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeNamespaces(ol,ls->title(lang)); } break; @@ -1152,7 +1143,7 @@ void GroupDefImpl::writeDocumentation(OutputList &ol) break; case LayoutDocEntry::MemberDecl: { - LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get(); writeMemberDeclarations(ol,lmd->type,lmd->title(lang)); } break; @@ -1161,7 +1152,7 @@ void GroupDefImpl::writeDocumentation(OutputList &ol) break; case LayoutDocEntry::DetailedDesc: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeDetailedDescription(ol,ls->title(lang)); } break; @@ -1170,7 +1161,7 @@ void GroupDefImpl::writeDocumentation(OutputList &ol) break; case LayoutDocEntry::MemberDef: { - LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde; + const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get(); writeMemberDocumentation(ol,lmd->type,lmd->title(lang)); } break; @@ -1179,7 +1170,7 @@ void GroupDefImpl::writeDocumentation(OutputList &ol) break; case LayoutDocEntry::GroupNestedGroups: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeNestedGroups(ol,ls->title(lang)); } break; @@ -1188,13 +1179,13 @@ void GroupDefImpl::writeDocumentation(OutputList &ol) break; case LayoutDocEntry::GroupDirs: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeDirs(ol,ls->title(lang)); } break; case LayoutDocEntry::GroupFiles: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeFiles(ol,ls->title(lang)); } break; diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index a9032b1..c9f7bf2 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -2275,17 +2275,15 @@ static bool quickLinkVisible(LayoutNavEntry::Kind kind) static void renderQuickLinksAsTree(FTextStream &t,const QCString &relPath,LayoutNavEntry *root) { - QListIterator<LayoutNavEntry> li(root->children()); - LayoutNavEntry *entry; int count=0; - for (li.toFirst();(entry=li.current());++li) + for (const auto &entry : root->children()) { if (entry->visible() && quickLinkVisible(entry->kind())) count++; } if (count>0) // at least one item is visible { startQuickIndexList(t,FALSE); - for (li.toFirst();(entry=li.current());++li) + for (const auto &entry : root->children()) { if (entry->visible() && quickLinkVisible(entry->kind())) { @@ -2294,7 +2292,7 @@ static void renderQuickLinksAsTree(FTextStream &t,const QCString &relPath,Layout t << fixSpaces(entry->title()); t << "</span></a>\n"; // recursive into child list - renderQuickLinksAsTree(t,relPath,entry); + renderQuickLinksAsTree(t,relPath,entry.get()); t << "</li>"; } } @@ -2311,28 +2309,25 @@ static void renderQuickLinksAsTabs(FTextStream &t,const QCString &relPath, { renderQuickLinksAsTabs(t,relPath,hlEntry->parent(),kind,highlightParent,highlightSearch); } - if (hlEntry->parent() && hlEntry->parent()->children().count()>0) // draw tabs for row containing hlEntry + if (hlEntry->parent() && !hlEntry->parent()->children().empty()) // draw tabs for row containing hlEntry { bool topLevel = hlEntry->parent()->parent()==0; - QListIterator<LayoutNavEntry> li(hlEntry->parent()->children()); - LayoutNavEntry *entry; - int count=0; - for (li.toFirst();(entry=li.current());++li) + for (const auto &entry : hlEntry->parent()->children()) { if (entry->visible() && quickLinkVisible(entry->kind())) count++; } if (count>0) // at least one item is visible { startQuickIndexList(t,TRUE,topLevel); - for (li.toFirst();(entry=li.current());++li) + for (const auto &entry : hlEntry->parent()->children()) { if (entry->visible() && quickLinkVisible(entry->kind())) { QCString url = entry->url(); startQuickIndexItem(t,url, - entry==hlEntry && - (entry->children().count()>0 || + entry.get()==hlEntry && + (!entry->children().empty() || (entry->kind()==kind && !highlightParent) ), TRUE,relPath); @@ -2475,7 +2470,7 @@ static void writeDefaultQuickLinks(FTextStream &t,bool compact, if (!hlEntry) // highlighted item not found in the index! -> just show the level 1 index... { highlightParent=TRUE; - hlEntry = root->children().getFirst(); + hlEntry = root->children().front().get(); if (hlEntry==0) { return; // argl, empty index! @@ -2483,7 +2478,7 @@ static void writeDefaultQuickLinks(FTextStream &t,bool compact, } if (kind==LayoutNavEntry::UserGroup) { - LayoutNavEntry *e = hlEntry->children().getFirst(); + LayoutNavEntry *e = hlEntry->children().front().get(); if (e) { hlEntry = e; diff --git a/src/index.cpp b/src/index.cpp index 5f29418..14ad720 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -371,13 +371,11 @@ void addMembersToIndex(T *def,LayoutDocManager::LayoutPart part, if (hasMembers || numClasses>0) { Doxygen::indexList->incContentsDepth(); - QListIterator<LayoutDocEntry> eli(LayoutDocManager::instance().docEntries(part)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(part)) { if (lde->kind()==LayoutDocEntry::MemberDef) { - LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde; + const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get(); MemberList *ml = def->getMemberList(lmd->type); if (ml) { @@ -1584,13 +1582,11 @@ static void writeClassTree(const ListType &cl,FTVHelp *ftv,bool addToIndex,bool static int countVisibleMembers(const NamespaceDef *nd) { int count=0; - QListIterator<LayoutDocEntry> eli(LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace)) { if (lde->kind()==LayoutDocEntry::MemberDef) { - LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde; + const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get(); MemberList *ml = nd->getMemberList(lmd->type); if (ml) { @@ -1611,13 +1607,11 @@ static int countVisibleMembers(const NamespaceDef *nd) static void writeNamespaceMembers(const NamespaceDef *nd,bool addToIndex) { - QListIterator<LayoutDocEntry> eli(LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace)) { if (lde->kind()==LayoutDocEntry::MemberDef) { - LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde; + const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get(); MemberList *ml = nd->getMemberList(lmd->type); if (ml) { @@ -3805,13 +3799,11 @@ static void writeGroupTreeNode(OutputList &ol, const GroupDef *gd, int level, FT ol.endTypewriter(); } - QListIterator<LayoutDocEntry> eli(LayoutDocManager::instance().docEntries(LayoutDocManager::Group)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Group)) { if (lde->kind()==LayoutDocEntry::MemberDef && addToIndex) { - LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde; + const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get(); MemberList *ml = gd->getMemberList(lmd->type); if (ml) { @@ -4070,17 +4062,15 @@ static void writeUserGroupStubPage(OutputList &ol,LayoutNavEntry *lne) ol.parseText(lne->title()); endTitle(ol,0,0); ol.startContents(); - QListIterator<LayoutNavEntry> li(lne->children()); - LayoutNavEntry *entry; int count=0; - for (li.toFirst();(entry=li.current());++li) + for (const auto &entry: lne->children()) { if (entry->visible()) count++; } if (count>0) { ol.writeString("<ul>\n"); - for (li.toFirst();(entry=li.current());++li) + for (const auto &entry: lne->children()) { if (entry->visible()) { @@ -4475,12 +4465,10 @@ static void writeIndex(OutputList &ol) static QArray<bool> indexWritten; -static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry> &entries) +static void writeIndexHierarchyEntries(OutputList &ol,const LayoutNavEntryList &entries) { static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE); - QListIterator<LayoutNavEntry> li(entries); - LayoutNavEntry *lne; - for (li.toFirst();(lne=li.current());++li) + for (const auto &lne : entries) { LayoutNavEntry::Kind kind = lne->kind(); uint index = (uint)kind; @@ -4522,7 +4510,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry Doxygen::indexList->incContentsDepth(); needsClosing=TRUE; } - if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Namespaces)!=lne) // for backward compatibility with old layout file + if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Namespaces)!=lne.get()) // for backward compatibility with old layout file { msg("Generating namespace index...\n"); writeNamespaceIndex(ol); @@ -4551,7 +4539,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry Doxygen::indexList->incContentsDepth(); needsClosing=TRUE; } - if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Classes)!=lne) // for backward compatibility with old layout file + if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Classes)!=lne.get()) // for backward compatibility with old layout file { msg("Generating annotated compound index...\n"); writeAnnotatedIndex(ol); @@ -4682,7 +4670,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry Doxygen::indexList->incContentsDepth(); needsClosing=TRUE; } - if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Files)!=lne) // for backward compatibility with old layout file + if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Files)!=lne.get()) // for backward compatibility with old layout file { msg("Generating file index...\n"); writeFileIndex(ol); @@ -4749,7 +4737,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry Doxygen::indexList->incContentsDepth(); needsClosing=TRUE; } - writeUserGroupStubPage(ol,lne); + writeUserGroupStubPage(ol,lne.get()); break; case LayoutNavEntry::None: assert(kind != LayoutNavEntry::None); // should never happen, means not properly initialized @@ -4884,10 +4872,8 @@ void renderMemberIndicesAsJs(FTextStream &t, static bool renderQuickLinksAsJs(FTextStream &t,LayoutNavEntry *root,bool first) { - QListIterator<LayoutNavEntry> li(root->children()); - LayoutNavEntry *entry; int count=0; - for (li.toFirst();(entry=li.current());++li) + for (const auto &entry : root->children()) { if (entry->visible() && quickLinkVisible(entry->kind())) count++; } @@ -4896,7 +4882,7 @@ static bool renderQuickLinksAsJs(FTextStream &t,LayoutNavEntry *root,bool first) bool firstChild = TRUE; if (!first) t << ","; t << "children:[" << endl; - for (li.toFirst();(entry=li.current());++li) + for (const auto &entry : root->children()) { if (entry->visible() && quickLinkVisible(entry->kind())) { @@ -4923,7 +4909,7 @@ static bool renderQuickLinksAsJs(FTextStream &t,LayoutNavEntry *root,bool first) } else // recursive into child list { - hasChildren = renderQuickLinksAsJs(t,entry,FALSE); + hasChildren = renderQuickLinksAsJs(t,entry.get(),FALSE); } if (hasChildren) t << "]"; t << "}"; diff --git a/src/layout.cpp b/src/layout.cpp index 5cac7e1..427747e 100644 --- a/src/layout.cpp +++ b/src/layout.cpp @@ -16,6 +16,8 @@ * */ +#include <array> + #include <assert.h> #include <qfile.h> #include <qfileinfo.h> @@ -103,9 +105,7 @@ LayoutNavEntry *LayoutNavEntry::find(LayoutNavEntry::Kind kind, const char *file) const { LayoutNavEntry *result=0; - QListIterator<LayoutNavEntry> li(m_children); - LayoutNavEntry *entry; - for (li.toFirst();(entry=li.current());++li) + for (const auto &entry : m_children) { // depth first search, needed to find the entry furthest from the // root in case an entry is in the tree twice @@ -113,7 +113,7 @@ LayoutNavEntry *LayoutNavEntry::find(LayoutNavEntry::Kind kind, if (result) return result; if (entry->kind()==kind && (file==0 || entry->baseFile()==file)) { - return entry; + return entry.get(); } } return result; @@ -1483,17 +1483,12 @@ int LayoutParser::m_userGroupCount=0; class LayoutDocManager::Private { public: - QList<LayoutDocEntry> docEntries[LayoutDocManager::NrParts]; + std::array<LayoutDocEntryList,LayoutDocManager::NrParts> docEntries; LayoutNavEntry *rootNav; }; LayoutDocManager::LayoutDocManager() : d(std::make_unique<Private>()) { - int i; - for (i=0;i<LayoutDocManager::NrParts;i++) - { - d->docEntries[i].setAutoDelete(TRUE); - } d->rootNav = new LayoutNavEntry; } @@ -1522,7 +1517,7 @@ LayoutDocManager & LayoutDocManager::instance() return *theInstance; } -const QList<LayoutDocEntry> &LayoutDocManager::docEntries(LayoutDocManager::LayoutPart part) const +const LayoutDocEntryList &LayoutDocManager::docEntries(LayoutDocManager::LayoutPart part) const { return d->docEntries[(int)part]; } @@ -1534,7 +1529,7 @@ LayoutNavEntry* LayoutDocManager::rootNavEntry() const void LayoutDocManager::addEntry(LayoutDocManager::LayoutPart p,LayoutDocEntry *e) { - d->docEntries[(int)p].append(e); + d->docEntries[(int)p].push_back(std::unique_ptr<LayoutDocEntry>(e)); } void LayoutDocManager::clear(LayoutDocManager::LayoutPart p) diff --git a/src/layout.h b/src/layout.h index 68d5c6e..4a0ae8c 100644 --- a/src/layout.h +++ b/src/layout.h @@ -20,10 +20,12 @@ #define LAYOUT_H #include <memory> +#include <vector> #include <qlist.h> #include "types.h" class LayoutParser; +struct LayoutNavEntry; class MemberList; class QTextStream; @@ -116,6 +118,8 @@ private: QCString m_title; }; +using LayoutNavEntryList = std::vector< std::unique_ptr<LayoutNavEntry> >; + /** @brief Base class for the layout of a navigation item at the top of the HTML pages. */ struct LayoutNavEntry { @@ -152,10 +156,13 @@ struct LayoutNavEntry UserGroup }; LayoutNavEntry(LayoutNavEntry *parent,Kind k,bool vs,const QCString &bf, - const QCString &tl,const QCString &intro,bool prepend=FALSE) + const QCString &tl,const QCString &intro,bool prepend=false) : m_parent(parent), m_kind(k), m_visible(vs), m_baseFile(bf), m_title(tl), m_intro(intro) - { m_children.setAutoDelete(TRUE); - if (parent) { if (prepend) parent->prependChild(this); else parent->addChild(this); } + { + if (parent) + { + if (prepend) parent->addChild(this); else parent->prependChild(this); + } } LayoutNavEntry *parent() const { return m_parent; } Kind kind() const { return m_kind; } @@ -165,9 +172,9 @@ struct LayoutNavEntry QCString url() const; bool visible() { return m_visible; } void clear() { m_children.clear(); } - void addChild(LayoutNavEntry *e) { m_children.append(e); } - void prependChild(LayoutNavEntry *e) { m_children.prepend(e); } - const QList<LayoutNavEntry> &children() const { return m_children; } + void addChild(LayoutNavEntry *e) { m_children.push_back(std::unique_ptr<LayoutNavEntry>(e)); } + void prependChild(LayoutNavEntry *e) { m_children.insert(m_children.begin(),std::unique_ptr<LayoutNavEntry>(e)); } + const LayoutNavEntryList &children() const { return m_children; } LayoutNavEntry *find(LayoutNavEntry::Kind k,const char *file=0) const; private: @@ -178,10 +185,12 @@ struct LayoutNavEntry QCString m_baseFile; QCString m_title; QCString m_intro; - QList<LayoutNavEntry> m_children; + LayoutNavEntryList m_children; friend class LayoutDocManager; }; +using LayoutDocEntryList = std::vector< std::unique_ptr<LayoutDocEntry> >; + /** @brief Singleton providing access to the (user configurable) layout of the documentation */ class LayoutDocManager { @@ -196,7 +205,7 @@ class LayoutDocManager static LayoutDocManager &instance(); /** Returns the list of LayoutDocEntry's in representation order for a given page identified by @a part. */ - const QList<LayoutDocEntry> &docEntries(LayoutPart part) const; + const LayoutDocEntryList &docEntries(LayoutPart part) const; /** returns the (invisible) root of the navigation tree. */ LayoutNavEntry *rootNavEntry() const; diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index 6ffac6b..d35ca6f 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -545,10 +545,7 @@ void NamespaceDefImpl::writeTagFile(FTextStream &tagFile) { tagFile << " <clangid>" << convertToXML(idStr) << "</clangid>" << endl; } - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace)) { switch (lde->kind()) { @@ -585,7 +582,7 @@ void NamespaceDefImpl::writeTagFile(FTextStream &tagFile) break; case LayoutDocEntry::MemberDecl: { - LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get(); MemberList * ml = getMemberList(lmd->type); if (ml) { @@ -785,51 +782,48 @@ void NamespaceDefImpl::writeSummaryLinks(OutputList &ol) const { ol.pushGeneratorState(); ol.disableAllBut(OutputGenerator::Html); - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace)); - LayoutDocEntry *lde; bool first=TRUE; SrcLangExt lang = getLanguage(); - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace)) { if (lde->kind()==LayoutDocEntry::NamespaceClasses && classes.declVisible()) { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); QCString label = "nested-classes"; ol.writeSummaryLink(0,label,ls->title(lang),first); first=FALSE; } else if (lde->kind()==LayoutDocEntry::NamespaceInterfaces && interfaces.declVisible()) { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); QCString label = "interfaces"; ol.writeSummaryLink(0,label,ls->title(lang),first); first=FALSE; } else if (lde->kind()==LayoutDocEntry::NamespaceStructs && structs.declVisible()) { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); QCString label = "structs"; ol.writeSummaryLink(0,label,ls->title(lang),first); first=FALSE; } else if (lde->kind()==LayoutDocEntry::NamespaceExceptions && exceptions.declVisible()) { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); QCString label = "exceptions"; ol.writeSummaryLink(0,label,ls->title(lang),first); first=FALSE; } else if (lde->kind()==LayoutDocEntry::NamespaceNestedNamespaces && namespaces.declVisible()) { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); QCString label = "namespaces"; ol.writeSummaryLink(0,label,ls->title(lang),first); first=FALSE; } else if (lde->kind()== LayoutDocEntry::MemberDecl) { - LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get(); MemberList * ml = getMemberList(lmd->type); if (ml && ml->declVisible()) { @@ -907,10 +901,7 @@ void NamespaceDefImpl::writeDocumentation(OutputList &ol) //---------------------------------------- start flexible part ------------------------------- SrcLangExt lang = getLanguage(); - QListIterator<LayoutDocEntry> eli( - LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace)); - LayoutDocEntry *lde; - for (eli.toFirst();(lde=eli.current());++eli) + for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace)) { switch (lde->kind()) { @@ -922,37 +913,37 @@ void NamespaceDefImpl::writeDocumentation(OutputList &ol) break; case LayoutDocEntry::NamespaceClasses: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeClassDeclarations(ol,ls->title(lang),classes); } break; case LayoutDocEntry::NamespaceInterfaces: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeClassDeclarations(ol,ls->title(lang),interfaces); } break; case LayoutDocEntry::NamespaceStructs: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeClassDeclarations(ol,ls->title(lang),structs); } break; case LayoutDocEntry::NamespaceExceptions: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeClassDeclarations(ol,ls->title(lang),exceptions); } break; case LayoutDocEntry::NamespaceNestedNamespaces: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeNamespaceDeclarations(ol,ls->title(lang),false); } break; case LayoutDocEntry::NamespaceNestedConstantGroups: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeNamespaceDeclarations(ol,ls->title(lang),true); } break; @@ -961,7 +952,7 @@ void NamespaceDefImpl::writeDocumentation(OutputList &ol) break; case LayoutDocEntry::MemberDecl: { - LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde; + const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get(); writeMemberDeclarations(ol,lmd->type,lmd->title(lang)); } break; @@ -970,7 +961,7 @@ void NamespaceDefImpl::writeDocumentation(OutputList &ol) break; case LayoutDocEntry::DetailedDesc: { - LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; + const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get(); writeDetailedDescription(ol,ls->title(lang)); } break; @@ -982,7 +973,7 @@ void NamespaceDefImpl::writeDocumentation(OutputList &ol) break; case LayoutDocEntry::MemberDef: { - LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde; + const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get(); writeMemberDocumentation(ol,lmd->type,lmd->title(lang)); } break; |