From ce1b208fc509b0638c2268fb5409241d0f8e69cc Mon Sep 17 00:00:00 2001 From: Zaid Ismail Date: Thu, 30 Jan 2025 01:34:52 +0200 Subject: [PATCH] Fix alphabetical sorting bug caused by case-sensitive string comparisons in GameListFrame. --- src/qt_gui/game_list_frame.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qt_gui/game_list_frame.h b/src/qt_gui/game_list_frame.h index 8c6fcb1e2..1d42c276c 100644 --- a/src/qt_gui/game_list_frame.h +++ b/src/qt_gui/game_list_frame.h @@ -8,6 +8,7 @@ #include #include #include +#include // std::tolower #include "background_music_player.h" #include "compatibility_info.h" @@ -66,7 +67,7 @@ public: static bool CompareStringsAscending(GameInfo a, GameInfo b, int columnIndex) { switch (columnIndex) { case 1: - return a.name < b.name; + return std::tolower(a.name) < std::tolower(b.name); case 2: return a.compatibility.status < b.compatibility.status; case 3: @@ -91,7 +92,7 @@ public: static bool CompareStringsDescending(GameInfo a, GameInfo b, int columnIndex) { switch (columnIndex) { case 1: - return a.name > b.name; + return std::tolower(a.name) > std::tolower(b.name); case 2: return a.compatibility.status > b.compatibility.status; case 3: