diff options
author | David Hebbeker <david@hebbeker.info> | 2020-05-02 17:43:59 (GMT) |
---|---|---|
committer | David Hebbeker <david@hebbeker.info> | 2020-05-05 16:28:49 (GMT) |
commit | 750e68e797b6b2500da3b9d770eafbb31b9d23fa (patch) | |
tree | 6519b5fe081caf3b2120dd9448f985b460f2a8e6 | |
parent | 0c28706a1e82a4ad6021ce016bc5937698cbbd3c (diff) | |
download | Doxygen-750e68e797b6b2500da3b9d770eafbb31b9d23fa.zip Doxygen-750e68e797b6b2500da3b9d770eafbb31b9d23fa.tar.gz Doxygen-750e68e797b6b2500da3b9d770eafbb31b9d23fa.tar.bz2 |
Create compareDirDefs for sorting.
-rw-r--r-- | src/dirdef.cpp | 7 | ||||
-rw-r--r-- | src/dirdef.h | 8 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/dirdef.cpp b/src/dirdef.cpp index d165b6e..b41dc01 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -15,6 +15,7 @@ #include "docparser.h" #include "definitionimpl.h" #include "filedef.h" +#include <algorithm> //---------------------------------------------------------------------- @@ -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(); } @@ -1092,3 +1093,7 @@ 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 deba35d..52af2d8 100644 --- a/src/dirdef.h +++ b/src/dirdef.h @@ -38,6 +38,9 @@ class DirDef; /** A list of directories. */ typedef std::deque<DirDef*> DirList; +/** Compare referenced objects. */ +bool compareDirDefs(const DirDef *item1,const DirDef *item2); + /** A model of a directory symbol. */ class DirDef : virtual public Definition { @@ -136,11 +139,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> { |