diff options
-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> { |