swlist: don't add switch item ordering menu entry when there's only 1 swlist item

This commit is contained in:
hap 2024-02-02 17:06:48 +01:00
parent 11c6138afc
commit 201ca82e0c

View File

@ -253,8 +253,14 @@ void menu_software_list::populate()
for (const software_info &swinfo : m_swlist->get_info())
append_software_entry(swinfo);
// add an entry to change ordering
item_append(_("Switch Item Ordering"), 0, ITEMREF_SWITCH_ITEM_ORDERING);
if (m_entrylist.size() > 1)
{
// add an entry to change ordering
item_append(_("Switch Item Ordering"), 0, ITEMREF_SWITCH_ITEM_ORDERING);
// initial cursor to first entry in the list
set_selected_index(1);
}
if (m_ordered_by_shortname)
{
@ -287,9 +293,6 @@ void menu_software_list::populate()
}
item_append(menu_item_type::SEPARATOR);
// initial cursor to first entry in the list
set_selected_index(1);
}