mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-05 00:42:48 +00:00
Fix bug with incorrect use of std::tolower.
This commit is contained in:
parent
ce1b208fc5
commit
c858ad6e8f
@ -3,12 +3,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <algorithm> // std::transform
|
||||
#include <cctype> // std::tolower
|
||||
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QNetworkRequest>
|
||||
#include <QPainter>
|
||||
#include <QScrollBar>
|
||||
#include <cctype> // std::tolower
|
||||
|
||||
#include "background_music_player.h"
|
||||
#include "compatibility_info.h"
|
||||
@ -66,8 +68,12 @@ public:
|
||||
|
||||
static bool CompareStringsAscending(GameInfo a, GameInfo b, int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 1:
|
||||
return std::tolower(a.name) < std::tolower(b.name);
|
||||
case 1: {
|
||||
std::string name_a = a.name, name_b = b.name;
|
||||
std::transform(name_a.begin(), name_a.end(), name_a.begin(), ::tolower);
|
||||
std::transform(name_b.begin(), name_b.end(), name_b.begin(), ::tolower);
|
||||
return name_a < name_b;
|
||||
}
|
||||
case 2:
|
||||
return a.compatibility.status < b.compatibility.status;
|
||||
case 3:
|
||||
@ -91,8 +97,12 @@ public:
|
||||
|
||||
static bool CompareStringsDescending(GameInfo a, GameInfo b, int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 1:
|
||||
return std::tolower(a.name) > std::tolower(b.name);
|
||||
case 1: {
|
||||
std::string name_a = a.name, name_b = b.name;
|
||||
std::transform(name_a.begin(), name_a.end(), name_a.begin(), ::tolower);
|
||||
std::transform(name_b.begin(), name_b.end(), name_b.begin(), ::tolower);
|
||||
return name_a > name_b;
|
||||
}
|
||||
case 2:
|
||||
return a.compatibility.status > b.compatibility.status;
|
||||
case 3:
|
||||
|
Loading…
Reference in New Issue
Block a user