sort single file ZIP files correctly (fixes #612)

This commit is contained in:
thrust26 2020-04-20 12:45:05 +02:00
parent c113df86da
commit 9981b256c7
1 changed files with 14 additions and 0 deletions

View File

@ -58,6 +58,20 @@ bool FilesystemNode::getChildren(FSList& fslist, ListMode mode,
if (!_realNode->getChildren(tmp, mode)) if (!_realNode->getChildren(tmp, mode))
return false; return false;
#if defined(ZIP_SUPPORT)
// before sorting, replace single file ZIP archive names with contained file names
// because they are displayed using their contained file names
for (auto& i : tmp)
{
if (BSPF::endsWithIgnoreCase(i->getPath(), ".zip"))
{
FilesystemNodeZIP node(i->getPath());
i->setName(node.getName());
}
}
#endif
std::sort(tmp.begin(), tmp.end(), std::sort(tmp.begin(), tmp.end(),
[](const AbstractFSNodePtr& node1, const AbstractFSNodePtr& node2) [](const AbstractFSNodePtr& node1, const AbstractFSNodePtr& node2)
{ {