summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd
diff options
context:
space:
mode:
author mahlemiut <bsr@xnet.co.nz>2016-12-16 14:33:23 +1300
committer mahlemiut <bsr@xnet.co.nz>2016-12-16 14:34:14 +1300
commit733df166a30a2ac35c9c80659e3cbfe628ae0847 (patch)
treeaf54c6113ec2ab4b7e7331b06f30f9cb697df74d /src/osd
parent9902322222e1e23add271c12937803d487be2418 (diff)
debugimgui: sort directory entries in mount dialog, as zippath_readdir() does not guarantee entries are in any particular order.
Diffstat (limited to 'src/osd')
-rw-r--r--src/osd/modules/debugger/debugimgui.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/osd/modules/debugger/debugimgui.cpp b/src/osd/modules/debugger/debugimgui.cpp
index de459240e85..a92ad53b5a1 100644
--- a/src/osd/modules/debugger/debugimgui.cpp
+++ b/src/osd/modules/debugger/debugimgui.cpp
@@ -1000,6 +1000,7 @@ void debug_imgui::refresh_filelist()
util::zippath_directory* dir = nullptr;
const char *volume_name;
const osd::directory::entry *dirent;
+ uint8_t first;
// todo
m_filelist.clear();
@@ -1019,6 +1020,7 @@ void debug_imgui::refresh_filelist()
m_filelist.emplace_back(std::move(temp));
x++;
}
+ first = m_filelist.size();
while((dirent = util::zippath_readdir(dir)) != nullptr)
{
file_entry temp;
@@ -1040,6 +1042,9 @@ void debug_imgui::refresh_filelist()
}
if (dir != nullptr)
util::zippath_closedir(dir);
+
+ // sort file list, as it is not guaranteed to be in any particular order
+ std::sort(m_filelist.begin()+first,m_filelist.end(),[](file_entry x, file_entry y) { return x.basename < y.basename; } );
}
void debug_imgui::refresh_typelist()