gui: Save sort mode if sorting is done successfully and sort based on sort mode on start up

This commit is contained in:
Joel 2022-07-24 15:29:12 -04:00 committed by GitHub
parent fd9e7d0ccb
commit b26bb0f439
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -171,8 +171,10 @@ namespace GUI {
case StateConfirmSort:
AppList::Backup();
backupExists = true;
if ((AppList::Save(entries.icons)) == 0)
if ((AppList::Save(entries.icons)) == 0) {
Config::Save(cfg);
state = StateDone;
}
else
state = StateError;
break;
@ -599,7 +601,11 @@ namespace GUI {
AppEntries entries;
std::vector<SceIoDirent> loadouts;
// Initial sort based on cfg.sort_mode
AppList::Get(entries);
std::sort(entries.icons.begin(), entries.icons.end(), cfg.sort_mode == SortAsc? AppList::SortAppDesc : AppList::SortAppDesc);
std::sort(entries.child_apps.begin(), entries.child_apps.end(), cfg.sort_mode == SortAsc? AppList::SortChildAppDesc : AppList::SortChildAppDesc);
FS::GetDirList("ux0:data/VITAHomebrewSorter/loadouts", loadouts);
int date_format = Utils::GetDateFormat();