diff --git a/Applications/Help/ManualSectionNode.cpp b/Applications/Help/ManualSectionNode.cpp index 402bb8b787..5ac4bc5350 100644 --- a/Applications/Help/ManualSectionNode.cpp +++ b/Applications/Help/ManualSectionNode.cpp @@ -27,6 +27,7 @@ #include "ManualSectionNode.h" #include "ManualPageNode.h" #include +#include #include #include @@ -43,12 +44,16 @@ void ManualSectionNode::reify_if_needed() const Core::DirIterator dir_iter { path(), Core::DirIterator::Flags::SkipDots }; + Vector page_names; while (dir_iter.has_next()) { FileSystemPath file_path(dir_iter.next_path()); if (file_path.extension() != "md") continue; - String page_name = file_path.title(); - NonnullOwnPtr child = make(*this, move(page_name)); - m_children.append(move(child)); + page_names.append(file_path.title()); } + + quick_sort(page_names); + + for (auto& page_name : page_names) + m_children.append(make(*this, move(page_name))); }