diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-05-10 13:35:14 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-05-10 13:35:14 (GMT) |
commit | 022dfa0f9f86499006050ab72d0da3101b501e9e (patch) | |
tree | b4bac19846f0f0afdbbac93632cc910b3c5febbe | |
parent | e24bad3c5d841435f42bd3ff7a39bdf551471c34 (diff) | |
parent | 1743f2717fbcb81472a29e4cac0d2fb018e7f5fa (diff) | |
download | Doxygen-022dfa0f9f86499006050ab72d0da3101b501e9e.zip Doxygen-022dfa0f9f86499006050ab72d0da3101b501e9e.tar.gz Doxygen-022dfa0f9f86499006050ab72d0da3101b501e9e.tar.bz2 |
Merge branch 'dhebbeker-feature/change-DirList-container-to-std'
-rw-r--r-- | qtools/qcstringlist.h | 4 | ||||
-rw-r--r-- | qtools/qstring.h | 15 | ||||
-rw-r--r-- | qtools/qvaluelist.h | 16 | ||||
-rw-r--r-- | src/context.cpp | 18 | ||||
-rw-r--r-- | src/context.h | 2 | ||||
-rw-r--r-- | src/dirdef.cpp | 24 | ||||
-rw-r--r-- | src/dirdef.h | 29 | ||||
-rw-r--r-- | src/dotdirdeps.cpp | 8 | ||||
-rw-r--r-- | src/dotgroupcollaboration.cpp | 32 | ||||
-rw-r--r-- | src/doxygen.cpp | 22 | ||||
-rw-r--r-- | src/groupdef.cpp | 38 | ||||
-rw-r--r-- | src/groupdef.h | 6 | ||||
-rw-r--r-- | src/index.cpp | 18 | ||||
-rw-r--r-- | src/sqlite3gen.cpp | 23 | ||||
-rw-r--r-- | src/xmlgen.cpp | 4 |
15 files changed, 123 insertions, 136 deletions
diff --git a/qtools/qcstringlist.h b/qtools/qcstringlist.h index 604a196..7ffd4d2 100644 --- a/qtools/qcstringlist.h +++ b/qtools/qcstringlist.h @@ -29,6 +29,10 @@ public: QCStringList( const QValueList<QCString>& l ) : QValueList<QCString>(l) { } QCStringList( const QCString& i ) { append(i); } QCStringList( const char* i ) { append(i); } + QCStringList &operator=(const QCStringList &l) + { + return static_cast<QCStringList&>(QValueList<QCString>::operator=(l)); + } static QCStringList fromStrList(const QStrList&); diff --git a/qtools/qstring.h b/qtools/qstring.h index 293768f..ed56d7f 100644 --- a/qtools/qstring.h +++ b/qtools/qstring.h @@ -1,5 +1,5 @@ /**************************************************************************** -** +** ** ** Definition of the QString class, and related Unicode ** functions. @@ -64,6 +64,7 @@ public: QChar( short rc ); QChar( uint rc ); QChar( int rc ); + QChar &operator=(const QChar &c); QT_STATIC_CONST QChar null; // 0000 QT_STATIC_CONST QChar replacement; // FFFD @@ -266,6 +267,15 @@ inline QChar::QChar( int rc ) #endif } +inline QChar &QChar::operator=(const QChar &c) +{ + rw = c.rw; + cl = c.cl; +#ifdef QT_QSTRING_UCS_4 + grp = 0; +#endif + return *this; +} inline int operator==( char ch, QChar c ) { @@ -409,7 +419,7 @@ public: inline QString(const Null &): d(shared_null) { d->ref(); } inline QString &operator=(const Null &) { *this = QString(); return *this; } inline bool isNull() const { return d == shared_null; } - + bool isEmpty() const; uint length() const; void truncate( uint pos ); @@ -603,6 +613,7 @@ class Q_EXPORT QCharRef { QString& s; uint p; QCharRef(QString* str, uint pos) : s(*str), p(pos) { } + QCharRef(const QCharRef &ref) : s(ref.s), p(ref.p) { } public: // Most QChar operations repeated here... diff --git a/qtools/qvaluelist.h b/qtools/qvaluelist.h index eb827fe..8885bea 100644 --- a/qtools/qvaluelist.h +++ b/qtools/qvaluelist.h @@ -1,5 +1,5 @@ /**************************************************************************** -** +** ** ** Definition of QValueList class ** @@ -50,7 +50,7 @@ public: QValueListNode( const T& t ) : data( t ) { } QValueListNode() { } #if defined(Q_TEMPLATEDLL) - // Workaround MS bug in memory de/allocation in DLL vs. EXE + // Workaround MS bug in memory de/allocation in DLL vs. EXE virtual ~QValueListNode() { } #endif @@ -79,6 +79,11 @@ class Q_EXPORT QValueListIterator QValueListIterator() : node( 0 ) {} QValueListIterator( NodePtr p ) : node( p ) {} QValueListIterator( const QValueListIterator<T>& it ) : node( it.node ) {} + QValueListIterator &operator=(const QValueListIterator &it) + { + node = it.node; + return *this; + } bool operator==( const QValueListIterator<T>& it ) const { return node == it.node; } bool operator!=( const QValueListIterator<T>& it ) const { return node != it.node; } @@ -132,6 +137,11 @@ class Q_EXPORT QValueListConstIterator QValueListConstIterator( NodePtr p ) : node( p ) {} QValueListConstIterator( const QValueListConstIterator<T>& it ) : node( it.node ) {} QValueListConstIterator( const QValueListIterator<T>& it ) : node( it.node ) {} + QValueListConstIterator &operator=(const QValueListConstIterator &it) + { + node = it.node; + return *this; + } bool operator==( const QValueListConstIterator<T>& it ) const { return node == it.node; } bool operator!=( const QValueListConstIterator<T>& it ) const { return node != it.node; } @@ -195,7 +205,7 @@ public: } #if defined(Q_TEMPLATEDLL) - // Workaround MS bug in memory de/allocation in DLL vs. EXE + // Workaround MS bug in memory de/allocation in DLL vs. EXE virtual #endif ~QValueListPrivate() { diff --git a/src/context.cpp b/src/context.cpp index af9a66c..9684870 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -3525,10 +3525,7 @@ class DirContext::Private : public DefinitionContext<DirContext::Private> if (!cache.dirs) { cache.dirs.reset(TemplateList::alloc()); - const DirList &subDirs = m_dirDef->subDirs(); - QListIterator<DirDef> it(subDirs); - const DirDef *dd; - for (it.toFirst();(dd=it.current());++it) + for(const auto dd : m_dirDef->subDirs()) { DirContext *dc = new DirContext(dd); cache.dirs->append(dc); @@ -5460,14 +5457,9 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private> if (!cache.dirs) { TemplateList *dirList = TemplateList::alloc(); - if (m_groupDef->getDirs()) + for(const auto dd : m_groupDef->getDirs()) { - QListIterator<DirDef> it(*m_groupDef->getDirs()); - const DirDef *dd; - for (it.toFirst();(dd=it.current());++it) - { - dirList->append(DirContext::alloc(dd)); - } + dirList->append(DirContext::alloc(dd)); } cache.dirs.reset(dirList); } @@ -6596,9 +6588,7 @@ class NestingContext::Private : public GenericNodeListContext } void addDirs(const DirList &dirList) { - QListIterator<DirDef> li(dirList); - const DirDef *dd; - for (li.toFirst();(dd=li.current());++li) + for(const auto dd : dirList) { append(NestingNodeContext::alloc(m_parent,dd,m_index,m_level,FALSE,FALSE,FALSE)); m_index++; diff --git a/src/context.h b/src/context.h index 929f06c..7256dc6 100644 --- a/src/context.h +++ b/src/context.h @@ -20,6 +20,7 @@ #include "template.h" #include <qlist.h> #include <stdio.h> +#include "dirdef.h" class Definition; class ClassDef; @@ -34,7 +35,6 @@ class FileDef; class FileList; class FileNameLinkedMap; class DirSDict; -class DirList; class DirDef; class PageSDict; class GroupSDict; diff --git a/src/dirdef.cpp b/src/dirdef.cpp index 70ca3c0..0f8f04b 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -15,6 +15,7 @@ #include "docparser.h" #include "definitionimpl.h" #include "filedef.h" +#include <algorithm> //---------------------------------------------------------------------- @@ -35,7 +36,7 @@ class DirDefImpl : public DefinitionImpl, public DirDef virtual FileList * getFiles() const { return m_fileList; } virtual void addFile(FileDef *fd); virtual const DirList &subDirs() const { return m_subdirs; } - virtual bool isCluster() const { return m_subdirs.count()>0; } + virtual bool isCluster() const { return m_subdirs.size()>0; } virtual int level() const { return m_level; } virtual DirDef *parent() const { return m_parent; } virtual int dirCount() const { return m_dirCount; } @@ -141,7 +142,7 @@ bool DirDefImpl::isLinkable() const void DirDefImpl::addSubDir(DirDef *subdir) { - m_subdirs.append(subdir); + m_subdirs.push_back(subdir); subdir->setOuterScope(this); subdir->setParent(this); } @@ -159,7 +160,7 @@ void DirDefImpl::addFile(FileDef *fd) void DirDefImpl::sort() { - m_subdirs.sort(); + std::sort(m_subdirs.begin(), m_subdirs.end(), compareDirDefs); m_fileList->sort(); } @@ -307,9 +308,7 @@ void DirDefImpl::writeDirectoryGraph(OutputList &ol) void DirDefImpl::writeSubDirList(OutputList &ol) { int numSubdirs = 0; - QListIterator<DirDef> it(m_subdirs); - DirDef *dd; - for (it.toFirst();(dd=it.current());++it) + for(const auto dd : m_subdirs) { if (dd->hasDocumentation() || dd->getFiles()->count()>0) { @@ -324,7 +323,7 @@ void DirDefImpl::writeSubDirList(OutputList &ol) ol.parseText(theTranslator->trDir(TRUE,FALSE)); ol.endMemberHeader(); ol.startMemberList(); - for (it.toFirst();(dd=it.current());++it) + for(const auto dd : m_subdirs) { if (dd->hasDocumentation() || dd->getFiles()->count()==0) { @@ -460,11 +459,9 @@ void DirDefImpl::writeTagFile(FTextStream &tagFile) { case LayoutDocEntry::DirSubDirs: { - if (m_subdirs.count()>0) + if (m_subdirs.size()>0) { - DirDef *dd; - QListIterator<DirDef> it(m_subdirs); - for (;(dd=it.current());++it) + for(const auto dd : m_subdirs) { tagFile << " <dir>" << convertToXML(dd->displayName()) << "</dir>" << endl; } @@ -1096,3 +1093,8 @@ void generateDirDocs(OutputList &ol) } } +bool compareDirDefs(const DirDef *item1, const DirDef *item2) +{ + return qstricmp(item1->shortName(),item2->shortName()) < 0; +} + diff --git a/src/dirdef.h b/src/dirdef.h index 692cd90..399e0c2 100644 --- a/src/dirdef.h +++ b/src/dirdef.h @@ -1,12 +1,10 @@ /****************************************************************************** * - * - * - * Copyright (C) 1997-2015 by Dimitri van Heesch. + * Copyright (C) 1997-2020 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -21,7 +19,9 @@ #include "sortdict.h" #include "definition.h" -#include <qlist.h> +#include <vector> +#include <qglobal.h> +#include <qcstring.h> class FileList; class ClassSDict; @@ -34,11 +34,9 @@ class FTextStream; class DirDef; /** A list of directories. */ -class DirList : public QList<DirDef> -{ - public: - int compareValues(const DirDef *item1,const DirDef *item2) const; -}; +typedef std::vector<DirDef*> DirList; + +bool compareDirDefs(const DirDef *item1, const DirDef *item2); /** A model of a directory symbol. */ class DirDef : virtual public Definition @@ -82,7 +80,7 @@ class DirDef : virtual public Definition }; /** Class representing a pair of FileDef objects */ -class FilePair +class FilePair { public: FilePair(FileDef *src,FileDef *dst) : m_src(src), m_dst(dst) {} @@ -125,7 +123,7 @@ class UsedDir class DirRelation { public: - DirRelation(const QCString &name,const DirDef *src,UsedDir *dst) + DirRelation(const QCString &name,const DirDef *src,UsedDir *dst) : m_name(name), m_src(src), m_dst(dst) {} const DirDef *source() const { return m_src; } UsedDir *destination() const { return m_dst; } @@ -138,11 +136,6 @@ class DirRelation UsedDir *m_dst; }; -inline int DirList::compareValues(const DirDef *item1,const DirDef *item2) const -{ - return qstricmp(item1->shortName(),item2->shortName()); -} - /** A sorted dictionary of DirDef objects. */ class DirSDict : public SDict<DirDef> { diff --git a/src/dotdirdeps.cpp b/src/dotdirdeps.cpp index 66a68df..c0e4712 100644 --- a/src/dotdirdeps.cpp +++ b/src/dotdirdeps.cpp @@ -55,11 +55,9 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations) << dd->shortName() << "\"];\n"; // add nodes for sub directories - QListIterator<DirDef> sdi(dd->subDirs()); - const DirDef *sdir; - for (sdi.toFirst();(sdir=sdi.current());++sdi) + for(const auto sdir : dd->subDirs()) { - t << " " << sdir->getOutputFileBase() << " [shape=box label=\"" + t << " " << sdir->getOutputFileBase() << " [shape=box label=\"" << sdir->shortName() << "\""; if (sdir->isCluster()) { @@ -70,7 +68,7 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations) t << " color=\"black\""; } t << " fillcolor=\"white\" style=\"filled\""; - t << " URL=\"" << sdir->getOutputFileBase() + t << " URL=\"" << sdir->getOutputFileBase() << Doxygen::htmlFileExtension << "\""; t << "];\n"; dirsInGraph.insert(sdir->getOutputFileBase(),sdir); diff --git a/src/dotgroupcollaboration.cpp b/src/dotgroupcollaboration.cpp index 0a56460..8121657 100644 --- a/src/dotgroupcollaboration.cpp +++ b/src/dotgroupcollaboration.cpp @@ -122,7 +122,7 @@ void DotGroupCollaboration::buildGraph(const GroupDef* gd) { tmp_url+="#"+def->anchor(); } - addCollaborationMember( def, tmp_url, DotGroupCollaboration::tclass ); + addCollaborationMember( def, tmp_url, DotGroupCollaboration::tclass ); } } @@ -134,7 +134,7 @@ void DotGroupCollaboration::buildGraph(const GroupDef* gd) for (;(def=defli.current());++defli) { tmp_url = def->getReference()+"$"+def->getOutputFileBase()+Doxygen::htmlFileExtension; - addCollaborationMember( def, tmp_url, DotGroupCollaboration::tnamespace ); + addCollaborationMember( def, tmp_url, DotGroupCollaboration::tnamespace ); } } @@ -146,7 +146,7 @@ void DotGroupCollaboration::buildGraph(const GroupDef* gd) for (;(def=defli.current());++defli) { tmp_url = def->getReference()+"$"+def->getOutputFileBase()+Doxygen::htmlFileExtension; - addCollaborationMember( def, tmp_url, DotGroupCollaboration::tfile ); + addCollaborationMember( def, tmp_url, DotGroupCollaboration::tfile ); } } @@ -158,19 +158,17 @@ void DotGroupCollaboration::buildGraph(const GroupDef* gd) for (;(def=defli.current());++defli) { tmp_url = def->getReference()+"$"+def->getOutputFileBase()+Doxygen::htmlFileExtension; - addCollaborationMember( def, tmp_url, DotGroupCollaboration::tpages ); + addCollaborationMember( def, tmp_url, DotGroupCollaboration::tpages ); } } // Add directories - if ( gd->getDirs() && gd->getDirs()->count() ) + if ( !gd->getDirs().empty() ) { - QListIterator<DirDef> defli(*gd->getDirs()); - const DirDef *def; - for (;(def=defli.current());++defli) + for(const auto def : gd->getDirs()) { tmp_url = def->getReference()+"$"+def->getOutputFileBase()+Doxygen::htmlFileExtension; - addCollaborationMember( def, tmp_url, DotGroupCollaboration::tdir ); + addCollaborationMember( def, tmp_url, DotGroupCollaboration::tdir ); } } } @@ -188,7 +186,7 @@ void DotGroupCollaboration::addMemberList( MemberList* ml ) } } -DotGroupCollaboration::Edge* DotGroupCollaboration::addEdge( +DotGroupCollaboration::Edge* DotGroupCollaboration::addEdge( DotNode* _pNStart, DotNode* _pNEnd, EdgeType _eType, const QCString& _label, const QCString& _url ) { @@ -197,9 +195,9 @@ DotGroupCollaboration::Edge* DotGroupCollaboration::addEdge( Edge* newEdge = 0; for ( lli.toFirst(); (newEdge=lli.current()); ++lli) { - if ( newEdge->pNStart==_pNStart && + if ( newEdge->pNStart==_pNStart && newEdge->pNEnd==_pNEnd && - newEdge->eType==_eType + newEdge->eType==_eType ) { // edge already found break; @@ -209,7 +207,7 @@ DotGroupCollaboration::Edge* DotGroupCollaboration::addEdge( { newEdge = new Edge(_pNStart,_pNEnd,_eType); m_edges.append( newEdge ); - } + } if (!_label.isEmpty()) { @@ -219,7 +217,7 @@ DotGroupCollaboration::Edge* DotGroupCollaboration::addEdge( return newEdge; } -void DotGroupCollaboration::addCollaborationMember( +void DotGroupCollaboration::addCollaborationMember( const Definition* def, QCString& url, EdgeType eType ) { // Create group nodes @@ -304,8 +302,8 @@ void DotGroupCollaboration::Edge::write( FTextStream &t ) const "darkorchid3" ,"orange" ,"blueviolet" - ,"darkgreen" - ,"firebrick4" + ,"darkgreen" + ,"firebrick4" ,"grey75" ,"midnightblue" }; @@ -341,7 +339,7 @@ void DotGroupCollaboration::Edge::write( FTextStream &t ) const const int maxLabels = 10; for( lli.toFirst(); (link=lli.current()) && count<maxLabels; ++lli,++count) { - if (first) first=FALSE; else t << "\\n"; + if (first) first=FALSE; else t << "\\n"; t << DotNode::convertLabel(link->label); } if (count==maxLabels) t << "\\n..."; diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 41d7b0a..efd8294 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -11172,6 +11172,17 @@ void parseInput() vhdlCorrectMemberProperties(); g_s.end(); + if (Config_getBool(SORT_GROUP_NAMES)) + { + Doxygen::groupSDict->sort(); + GroupSDict::Iterator gli(*Doxygen::groupSDict); + GroupDef *gd; + for (gli.toFirst();(gd=gli.current());++gli) + { + gd->sortSubGroups(); + } + } + } void generateOutput() @@ -11349,17 +11360,6 @@ void generateOutput() generateDirDocs(*g_outputList); g_s.end(); - if (Config_getBool(SORT_GROUP_NAMES)) - { - Doxygen::groupSDict->sort(); - GroupSDict::Iterator gli(*Doxygen::groupSDict); - GroupDef *gd; - for (gli.toFirst();(gd=gli.current());++gli) - { - gd->sortSubGroups(); - } - } - if (g_outputList->count()>0) { writeIndexHierarchy(*g_outputList); diff --git a/src/groupdef.cpp b/src/groupdef.cpp index df053ed..3b4d537 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -64,7 +64,7 @@ class GroupDefImpl : public DefinitionImpl, public GroupDef virtual void addGroup(const GroupDef *def); virtual void addPage(PageDef *def); virtual void addExample(const PageDef *def); - virtual void addDir(const DirDef *dd); + virtual void addDir(DirDef *dd); virtual bool insertMember(MemberDef *def,bool docOnly=FALSE); virtual void removeMember(MemberDef *md); virtual bool findGroup(const GroupDef *def) const; // true if def is a subgroup of this group @@ -101,7 +101,7 @@ class GroupDefImpl : public DefinitionImpl, public GroupDef virtual NamespaceSDict * getNamespaces() const { return m_namespaceSDict; } virtual GroupList * getSubGroups() const { return m_groupList; } virtual PageSDict * getPages() const { return m_pageDict; } - virtual DirList * getDirs() const { return m_dirList; } + virtual const DirList & getDirs() const { return m_dirList; } virtual PageSDict * getExamples() const { return m_exampleDict; } virtual bool hasDetailedDescription() const; virtual void sortSubGroups(); @@ -141,7 +141,7 @@ class GroupDefImpl : public DefinitionImpl, public GroupDef GroupList * m_groupList; // list of sub groups. PageSDict * m_pageDict; // list of pages in the group PageSDict * m_exampleDict; // list of examples in the group - DirList * m_dirList; // list of directories in the group + DirList m_dirList; // list of directories in the group MemberList * m_allMemberList; MemberNameInfoLinkedMap m_allMemberNameInfoLinkedMap; Definition * m_groupScope; @@ -169,7 +169,6 @@ GroupDefImpl::GroupDefImpl(const char *df,int dl,const char *na,const char *t, m_namespaceSDict = new NamespaceSDict(17); m_pageDict = new PageSDict(17); m_exampleDict = new PageSDict(17); - m_dirList = new DirList; if (refFileName) { m_fileName=stripExtension(refFileName); @@ -199,7 +198,6 @@ GroupDefImpl::~GroupDefImpl() delete m_exampleDict; delete m_allMemberList; delete m_memberGroupSDict; - delete m_dirList; } void GroupDefImpl::setGroupTitle( const char *t ) @@ -324,13 +322,10 @@ bool GroupDefImpl::addNamespace(const NamespaceDef *def) return FALSE; } -void GroupDefImpl::addDir(const DirDef *def) +void GroupDefImpl::addDir(DirDef *def) { if (def->isHidden()) return; - if (Config_getBool(SORT_BRIEF_DOCS)) - m_dirList->inSort(def); - else - m_dirList->append(def); + m_dirList.push_back(def); } void GroupDefImpl::addPage(PageDef *def) @@ -753,16 +748,11 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile) break; case LayoutDocEntry::GroupDirs: { - if (m_dirList) + for(const auto dd : m_dirList) { - QListIterator<DirDef> it(*m_dirList); - DirDef *dd; - for (;(dd=it.current());++it) + if (dd->isLinkableInProject()) { - if (dd->isLinkableInProject()) - { - tagFile << " <dir>" << convertToXML(dd->displayName()) << "</dir>" << endl; - } + tagFile << " <dir>" << convertToXML(dd->displayName()) << "</dir>" << endl; } } } @@ -1022,15 +1012,13 @@ void GroupDefImpl::writeNestedGroups(OutputList &ol,const QCString &title) void GroupDefImpl::writeDirs(OutputList &ol,const QCString &title) { // write list of directories - if (m_dirList->count()>0) + if (!m_dirList.empty()) { ol.startMemberHeader("dirs"); ol.parseText(title); ol.endMemberHeader(); ol.startMemberList(); - QListIterator<DirDef> it(*m_dirList); - DirDef *dd; - for (;(dd=it.current());++it) + for(const auto dd : m_dirList) { if (!dd->hasDocumentation()) continue; ol.startMemberDeclaration(); @@ -1160,7 +1148,7 @@ void GroupDefImpl::writeSummaryLinks(OutputList &ol) const (lde->kind()==LayoutDocEntry::GroupNamespaces && m_namespaceSDict->declVisible()) || (lde->kind()==LayoutDocEntry::GroupFiles && m_fileList->count()>0) || (lde->kind()==LayoutDocEntry::GroupNestedGroups && m_groupList->count()>0) || - (lde->kind()==LayoutDocEntry::GroupDirs && m_dirList->count()>0) + (lde->kind()==LayoutDocEntry::GroupDirs && !m_dirList.empty()) ) { LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde; @@ -1693,6 +1681,10 @@ void GroupDefImpl::sortMemberLists() { if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(FALSE); } } + if (Config_getBool(SORT_BRIEF_DOCS)) + { + std::sort(m_dirList.begin(), m_dirList.end(), compareDirDefs); + } } MemberList *GroupDefImpl::getMemberList(MemberListType lt) const diff --git a/src/groupdef.h b/src/groupdef.h index c210d9e..82fa004 100644 --- a/src/groupdef.h +++ b/src/groupdef.h @@ -22,6 +22,7 @@ #include "sortdict.h" #include "definition.h" +#include "dirdef.h" class MemberList; class FileList; @@ -36,7 +37,6 @@ class MemberGroupSDict; class PageSDict; class PageDef; class DirDef; -class DirList; class FTVHelp; class Entry; class MemberDef; @@ -61,7 +61,7 @@ class GroupDef : virtual public Definition virtual void addGroup(const GroupDef *def) = 0; virtual void addPage(PageDef *def) = 0; virtual void addExample(const PageDef *def) = 0; - virtual void addDir(const DirDef *dd) = 0; + virtual void addDir(DirDef *dd) = 0; virtual bool insertMember(MemberDef *def,bool docOnly=FALSE) = 0; virtual void removeMember(MemberDef *md) = 0; virtual bool findGroup(const GroupDef *def) const = 0; @@ -98,7 +98,7 @@ class GroupDef : virtual public Definition virtual NamespaceSDict * getNamespaces() const = 0; virtual GroupList * getSubGroups() const = 0; virtual PageSDict * getPages() const = 0; - virtual DirList * getDirs() const = 0; + virtual const DirList & getDirs() const = 0; virtual PageSDict * getExamples() const = 0; virtual bool hasDetailedDescription() const = 0; virtual void sortSubGroups() = 0; diff --git a/src/index.cpp b/src/index.cpp index fd61a45..db58129 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -587,9 +587,7 @@ static bool dirHasVisibleChildren(DirDef *dd) } } - QListIterator<DirDef> dli(dd->subDirs()); - DirDef *subdd; - for (dli.toFirst();(subdd=dli.current());++dli) + for(const auto subdd : dd->subDirs()) { if (dirHasVisibleChildren(subdd)) { @@ -617,7 +615,7 @@ static void writeDirTreeNode(OutputList &ol, DirDef *dd, int level, FTVHelp* ftv } static bool tocExpand = TRUE; //Config_getBool(TOC_EXPAND); - bool isDir = dd->subDirs().count()>0 || // there are subdirs + bool isDir = dd->subDirs().size()>0 || // there are subdirs (tocExpand && // or toc expand and dd->getFiles() && dd->getFiles()->count()>0 // there are files ); @@ -646,12 +644,10 @@ static void writeDirTreeNode(OutputList &ol, DirDef *dd, int level, FTVHelp* ftv } // write sub directories - if (dd->subDirs().count()>0) + if (dd->subDirs().size()>0) { startIndexHierarchy(ol,level+1); - QListIterator<DirDef> dli(dd->subDirs()); - DirDef *subdd = 0; - for (dli.toFirst();(subdd=dli.current());++dli) + for(const auto subdd : dd->subDirs()) { writeDirTreeNode(ol,subdd,level+1,ftv,addToIndex); } @@ -3992,7 +3988,7 @@ static void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* numSubItems += gd->getNamespaces()->count(); numSubItems += gd->getClasses()->count(); numSubItems += gd->getFiles()->count(); - numSubItems += gd->getDirs()->count(); + numSubItems += gd->getDirs().size(); numSubItems += gd->getPages()->count(); } @@ -4125,9 +4121,7 @@ static void writeGroupTreeNode(OutputList &ol, GroupDef *gd, int level, FTVHelp* } else if (lde->kind()==LayoutDocEntry::GroupDirs && addToIndex) { - QListIterator<DirDef> it(*gd->getDirs()); - DirDef *dd; - for (;(dd=it.current());++it) + for (const auto dd : gd->getDirs()) { if (dd->isVisible()) { diff --git a/src/sqlite3gen.cpp b/src/sqlite3gen.cpp index 957095a..f767eab 100644 --- a/src/sqlite3gen.cpp +++ b/src/sqlite3gen.cpp @@ -1336,20 +1336,15 @@ static void writeInnerFiles(const FileList *fl, struct Refid outer_refid) } } -static void writeInnerDirs(const DirList *dl, struct Refid outer_refid) +static void writeInnerDirs(const DirList &dl, struct Refid outer_refid) { - if (dl) + for (const auto subdir : dl) { - QListIterator<DirDef> subdirs(*dl); - const DirDef *subdir; - for (subdirs.toFirst();(subdir=subdirs.current());++subdirs) - { - struct Refid inner_refid = insertRefid(subdir->getOutputFileBase()); + struct Refid inner_refid = insertRefid(subdir->getOutputFileBase()); - bindIntParameter(contains_insert,":inner_rowid", inner_refid.rowid); - bindIntParameter(contains_insert,":outer_rowid", outer_refid.rowid); - step(contains_insert); - } + bindIntParameter(contains_insert,":inner_rowid", inner_refid.rowid); + bindIntParameter(contains_insert,":outer_rowid", outer_refid.rowid); + step(contains_insert); } } @@ -2423,7 +2418,7 @@ static void generateSqlite3ForDir(const DirDef *dd) step(compounddef_insert); // + files - writeInnerDirs(&dd->subDirs(),refid); + writeInnerDirs(dd->subDirs(),refid); // + files writeInnerFiles(dd->getFiles(),refid); @@ -2516,12 +2511,14 @@ static sqlite3* openDbConnection() if (rc != SQLITE_OK) { err("sqlite3_initialize failed\n"); + return NULL; } if (stat (outputDirectory+"/doxygen_sqlite3.db", &buf) == 0) { - err("doxygen_sqlite3.db already exists! Rename, remove, or archive it to regenerate. Aborting!\n"); + err("doxygen_sqlite3.db already exists! Rename, remove, or archive it to regenerate\n"); + return NULL; } rc = sqlite3_open_v2( diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 2424853..3a649e9 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -1207,9 +1207,7 @@ static void writeInnerDirs(const DirList *dl,FTextStream &t) { if (dl) { - QListIterator<DirDef> subdirs(*dl); - DirDef *subdir; - for (subdirs.toFirst();(subdir=subdirs.current());++subdirs) + for(const auto subdir : *dl) { t << " <innerdir refid=\"" << subdir->getOutputFileBase() << "\">" << convertToXML(subdir->displayName()) << "</innerdir>" << endl; |