Skip to content

Commit 036fd4e

Browse files
committed
Fix favorites sorting
1 parent 0570875 commit 036fd4e

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.PHONY: all setup build package release clean
22

33
TARGET=SearchFilter
4-
VERSION=1.3
4+
VERSION=1.2.2
55

66
###########################################################
77

src/common/utils.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#include <vector>
99
#include <map>
1010
#include <functional>
11+
#include <algorithm>
12+
#include <cctype>
1113
#include <unistd.h>
1214
#include <dirent.h>
1315

@@ -127,6 +129,14 @@ string wrapQuotes(const string &s, const string quote_char = "\"") {
127129
return quote_char + s + quote_char;
128130
}
129131

132+
string tolower(const string &s)
133+
{
134+
string result = s;
135+
std::transform(result.begin(), result.end(), result.begin(),
136+
[](unsigned char c){ return std::tolower(c); });
137+
return result;
138+
}
139+
130140
string dirname(string path)
131141
{
132142
int pos = path.find_last_of("/");

src/tools/tools.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void sortFavorites(void)
4343
string contents = "";
4444

4545
sort(favorites.begin(), favorites.end(), [](GameJsonEntry a, GameJsonEntry b) {
46-
return a.label < b.label;
46+
return tolower(a.label) < tolower(b.label);
4747
});
4848

4949
for (auto &entry : favorites)

0 commit comments

Comments
 (0)