Case insensitive sort the download list
(as uppercase so `[` is at the end)
This commit is contained in:
parent
6e47789ef6
commit
2b14b58dcf
1 changed files with 14 additions and 0 deletions
|
|
@ -483,6 +483,20 @@ std::vector<std::string> Store::GetDownloadList(int index) const {
|
|||
if (it.key() != "info") temp.push_back(it.key());
|
||||
}
|
||||
|
||||
std::sort(temp.begin(), temp.end(), [](const std::string &aString, const std::string &bString) {
|
||||
const char *a = aString.c_str(), *b = bString.c_str();
|
||||
while (*a && *b) {
|
||||
int cmp = toupper(*a) - toupper(*b);
|
||||
if (cmp < 0) return true;
|
||||
else if (cmp > 0) return false;
|
||||
|
||||
a++;
|
||||
b++;
|
||||
}
|
||||
|
||||
return *a == 0;
|
||||
});
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue