sort local saves alphabetically, accounting for uppercase/lowercase

This commit is contained in:
jacob1 2017-12-27 11:50:28 -05:00
parent 887d60628d
commit 70bbb16f37

View File

@ -59,7 +59,11 @@ class LoadFilesTask: public Task
virtual bool doWork() virtual bool doWork()
{ {
std::vector<std::string> files = Client::Ref().DirectorySearch(directory, search, ".cps"); std::vector<std::string> files = Client::Ref().DirectorySearch(directory, search, ".cps");
sort(files.rbegin(), files.rend()); std::sort(files.rbegin(), files.rend(), [](std::string a, std::string b) {
std::transform(a.begin(), a.end(), a.begin(), ::tolower);
std::transform(b.begin(), b.end(), b.begin(), ::tolower);
return a < b;
});
notifyProgress(-1); notifyProgress(-1);
for(std::vector<std::string>::iterator iter = files.begin(), end = files.end(); iter != end; ++iter) for(std::vector<std::string>::iterator iter = files.begin(), end = files.end(); iter != end; ++iter)