mirror of
https://github.com/holub/mame
synced 2025-07-01 16:19:38 +03:00
swlist: refactor prev commit
This commit is contained in:
parent
346c612c2c
commit
db82052c9a
@ -251,10 +251,17 @@ void menu_software_list::populate()
|
|||||||
for (const software_info &swinfo : m_swlist->get_info())
|
for (const software_info &swinfo : m_swlist->get_info())
|
||||||
append_software_entry(swinfo);
|
append_software_entry(swinfo);
|
||||||
|
|
||||||
|
// add an entry to change ordering
|
||||||
|
item_append(_("Switch Item Ordering"), 0, ITEMREF_SWITCH_ITEM_ORDERING);
|
||||||
|
|
||||||
if (m_ordered_by_shortname)
|
if (m_ordered_by_shortname)
|
||||||
{
|
{
|
||||||
// short names are restricted to lowercase ASCII anyway, a dumb compare works
|
// short names are restricted to lowercase ASCII anyway, a dumb compare works
|
||||||
m_entrylist.sort([] (entry_info const &e1, entry_info const &e2) { return e1.short_name < e2.short_name; });
|
m_entrylist.sort([] (entry_info const &e1, entry_info const &e2) { return e1.short_name < e2.short_name; });
|
||||||
|
|
||||||
|
// append all of the menu entries
|
||||||
|
for (auto &entry : m_entrylist)
|
||||||
|
item_append(entry.short_name, entry.long_name, 0, &entry);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -271,17 +278,9 @@ void menu_software_list::populate()
|
|||||||
else
|
else
|
||||||
return e1.short_name < e2.short_name;
|
return e1.short_name < e2.short_name;
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
// add an entry to change ordering
|
|
||||||
item_append(_("Switch Item Ordering"), 0, ITEMREF_SWITCH_ITEM_ORDERING);
|
|
||||||
|
|
||||||
// append all of the menu entries
|
// append all of the menu entries
|
||||||
for (auto &entry : m_entrylist)
|
for (auto &entry : m_entrylist)
|
||||||
{
|
|
||||||
if (m_ordered_by_shortname)
|
|
||||||
item_append(entry.short_name, entry.long_name, 0, &entry);
|
|
||||||
else
|
|
||||||
item_append(entry.long_name, entry.short_name, 0, &entry);
|
item_append(entry.long_name, entry.short_name, 0, &entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user