mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-16 20:15:38 +00:00
Changed the sort types 'filename, ascending' and 'filename, descending' to 'name, ascending' and 'name, descending'
This commit is contained in:
parent
fafea1c9cb
commit
2aa74878bb
|
@ -532,14 +532,14 @@ void FileData::sort(ComparisonFunction& comparator,
|
|||
}
|
||||
}
|
||||
|
||||
// If the requested sorting is not by filename, then sort in ascending filename order
|
||||
// as a first step, in order to get a correct secondary sorting.
|
||||
if (getSortTypeFromString("filename, ascending").comparisonFunction != comparator &&
|
||||
getSortTypeFromString("filename, descending").comparisonFunction != comparator) {
|
||||
// If the requested sorting is not by name, then sort in ascending name order as a first
|
||||
// step, in order to get a correct secondary sorting.
|
||||
if (getSortTypeFromString("name, ascending").comparisonFunction != comparator &&
|
||||
getSortTypeFromString("name, descending").comparisonFunction != comparator) {
|
||||
std::stable_sort(mChildrenFolders.begin(), mChildrenFolders.end(),
|
||||
getSortTypeFromString("filename, ascending").comparisonFunction);
|
||||
getSortTypeFromString("name, ascending").comparisonFunction);
|
||||
std::stable_sort(mChildrenOthers.begin(), mChildrenOthers.end(),
|
||||
getSortTypeFromString("filename, ascending").comparisonFunction);
|
||||
getSortTypeFromString("name, ascending").comparisonFunction);
|
||||
}
|
||||
|
||||
if (foldersOnTop)
|
||||
|
@ -553,12 +553,12 @@ void FileData::sort(ComparisonFunction& comparator,
|
|||
mChildren.insert(mChildren.end(), mChildrenOthers.begin(), mChildrenOthers.end());
|
||||
}
|
||||
else {
|
||||
// If the requested sorting is not by filename, then sort in ascending filename order
|
||||
// as a first step, in order to get a correct secondary sorting.
|
||||
if (getSortTypeFromString("filename, ascending").comparisonFunction != comparator &&
|
||||
getSortTypeFromString("filename, descending").comparisonFunction != comparator)
|
||||
// If the requested sorting is not by name, then sort in ascending name order as a first
|
||||
// step, in order to get a correct secondary sorting.
|
||||
if (getSortTypeFromString("name, ascending").comparisonFunction != comparator &&
|
||||
getSortTypeFromString("name, descending").comparisonFunction != comparator)
|
||||
std::stable_sort(mChildren.begin(), mChildren.end(),
|
||||
getSortTypeFromString("filename, ascending").comparisonFunction);
|
||||
getSortTypeFromString("name, ascending").comparisonFunction);
|
||||
|
||||
std::stable_sort(mChildren.begin(), mChildren.end(), comparator);
|
||||
}
|
||||
|
@ -671,21 +671,21 @@ void FileData::sortFavoritesOnTop(ComparisonFunction& comparator,
|
|||
mChildrenFavoritesFolders.erase(mChildrenFavoritesFolders.begin(),
|
||||
mChildrenFavoritesFolders.end());
|
||||
std::stable_sort(mChildrenFolders.begin(), mChildrenFolders.end(),
|
||||
getSortTypeFromString("filename, ascending").comparisonFunction);
|
||||
getSortTypeFromString("name, ascending").comparisonFunction);
|
||||
}
|
||||
|
||||
// If the requested sorting is not by filename, then sort in ascending filename order
|
||||
// as a first step, in order to get a correct secondary sorting.
|
||||
if (getSortTypeFromString("filename, ascending").comparisonFunction != comparator &&
|
||||
getSortTypeFromString("filename, descending").comparisonFunction != comparator) {
|
||||
// If the requested sorting is not by name, then sort in ascending name order as a first
|
||||
// step, in order to get a correct secondary sorting.
|
||||
if (getSortTypeFromString("name, ascending").comparisonFunction != comparator &&
|
||||
getSortTypeFromString("name, descending").comparisonFunction != comparator) {
|
||||
std::stable_sort(mChildrenFolders.begin(), mChildrenFolders.end(),
|
||||
getSortTypeFromString("filename, ascending").comparisonFunction);
|
||||
getSortTypeFromString("name, ascending").comparisonFunction);
|
||||
std::stable_sort(mChildrenFavoritesFolders.begin(), mChildrenFavoritesFolders.end(),
|
||||
getSortTypeFromString("filename, ascending").comparisonFunction);
|
||||
getSortTypeFromString("name, ascending").comparisonFunction);
|
||||
std::stable_sort(mChildrenFavorites.begin(), mChildrenFavorites.end(),
|
||||
getSortTypeFromString("filename, ascending").comparisonFunction);
|
||||
getSortTypeFromString("name, ascending").comparisonFunction);
|
||||
std::stable_sort(mChildrenOthers.begin(), mChildrenOthers.end(),
|
||||
getSortTypeFromString("filename, ascending").comparisonFunction);
|
||||
getSortTypeFromString("name, ascending").comparisonFunction);
|
||||
}
|
||||
|
||||
// Sort favorite games and the other games separately.
|
||||
|
@ -809,7 +809,7 @@ const FileData::SortType& FileData::getSortTypeFromString(const std::string& des
|
|||
if (sort.description == desc)
|
||||
return sort;
|
||||
}
|
||||
// If no type was found then default to "filename, ascending".
|
||||
// If no type was found then default to "name, ascending".
|
||||
return FileSorts::SortTypes.at(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
namespace FileSorts
|
||||
{
|
||||
const FileData::SortType typesArr[] {
|
||||
FileData::SortType(&compareName, "filename, ascending"),
|
||||
FileData::SortType(&compareNameDescending, "filename, descending"),
|
||||
FileData::SortType(&compareName, "name, ascending"),
|
||||
FileData::SortType(&compareNameDescending, "name, descending"),
|
||||
|
||||
FileData::SortType(&compareRating, "rating, ascending"),
|
||||
FileData::SortType(&compareRatingDescending, "rating, descending"),
|
||||
|
|
|
@ -466,7 +466,7 @@ void GuiMenu::openUIOptions()
|
|||
getHelpStyle(), "DEFAULT SORT ORDER", false);
|
||||
// Exclude the System sort options.
|
||||
unsigned int numSortTypes {static_cast<unsigned int>(FileSorts::SortTypes.size() - 2)};
|
||||
for (unsigned int i = 0; i < numSortTypes; ++i) {
|
||||
for (unsigned int i {0}; i < numSortTypes; ++i) {
|
||||
if (FileSorts::SortTypes[i].description ==
|
||||
Settings::getInstance()->getString("DefaultSortOrder")) {
|
||||
sortOrder = FileSorts::SortTypes[i].description;
|
||||
|
@ -474,10 +474,13 @@ void GuiMenu::openUIOptions()
|
|||
}
|
||||
}
|
||||
// If an invalid sort order was defined in es_settings.xml, then apply the default
|
||||
// sort order 'filename, ascending'.
|
||||
if (sortOrder == "")
|
||||
// sort order "name, ascending".
|
||||
if (sortOrder == "") {
|
||||
sortOrder = Settings::getInstance()->getDefaultString("DefaultSortOrder");
|
||||
for (unsigned int i = 0; i < numSortTypes; ++i) {
|
||||
Settings::getInstance()->setString("DefaultSortOrder", sortOrder);
|
||||
s->setNeedsSaving();
|
||||
}
|
||||
for (unsigned int i {0}; i < numSortTypes; ++i) {
|
||||
const FileData::SortType& sort {FileSorts::SortTypes[i]};
|
||||
if (sort.description == sortOrder)
|
||||
defaultSortOrder->add(sort.description, &sort, true);
|
||||
|
|
|
@ -777,7 +777,7 @@ void GuiScraperMenu::openOfflineGenerator(GuiSettings* settings)
|
|||
for (auto sys = systems.cbegin(); sys != systems.cend(); ++sys) {
|
||||
std::vector<FileData*> games {(*sys)->getRootFolder()->getChildrenRecursive()};
|
||||
|
||||
// Sort the games by "filename, ascending".
|
||||
// Sort the games by "name, ascending".
|
||||
std::stable_sort(games.begin(), games.end(), FileSorts::SortTypes.at(0).comparisonFunction);
|
||||
|
||||
for (FileData* game : games)
|
||||
|
|
|
@ -164,7 +164,7 @@ void Settings::setDefaults()
|
|||
mStringMap["ThemeTransitions"] = {"automatic", "automatic"};
|
||||
mStringMap["QuickSystemSelect"] = {"leftrightshoulders", "leftrightshoulders"};
|
||||
mStringMap["StartupSystem"] = {"", ""};
|
||||
mStringMap["DefaultSortOrder"] = {"filename, ascending", "filename, ascending"};
|
||||
mStringMap["DefaultSortOrder"] = {"name, ascending", "name, ascending"};
|
||||
mStringMap["MenuColorScheme"] = {"dark", "dark"};
|
||||
mStringMap["MenuOpeningEffect"] = {"scale-up", "scale-up"};
|
||||
mStringMap["LaunchScreenDuration"] = {"normal", "normal"};
|
||||
|
|
Loading…
Reference in a new issue