mirror of https://github.com/stella-emu/stella.git
sort single file ZIP files correctly (fixes #612)
This commit is contained in:
parent
c113df86da
commit
9981b256c7
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue