This commit is contained in:
Nayla Hanegan 2024-11-04 10:59:00 -05:00
commit 76c08d3a22
119 changed files with 47784 additions and 40258 deletions

View file

@ -317,20 +317,14 @@ void GeckoCodeWidget::SortAlphabetically()
void GeckoCodeWidget::SortEnabledCodesFirst()
{
std::stable_sort(m_gecko_codes.begin(), m_gecko_codes.end(), [](const auto& a, const auto& b) {
return a.enabled && a.enabled != b.enabled;
});
std::ranges::stable_partition(m_gecko_codes, std::identity{}, &Gecko::GeckoCode::enabled);
UpdateList();
SaveCodes();
}
void GeckoCodeWidget::SortDisabledCodesFirst()
{
std::stable_sort(m_gecko_codes.begin(), m_gecko_codes.end(), [](const auto& a, const auto& b) {
return !a.enabled && a.enabled != b.enabled;
});
std::ranges::stable_partition(m_gecko_codes, std::logical_not{}, &Gecko::GeckoCode::enabled);
UpdateList();
SaveCodes();
}