From 46a5fb1fbcf055e7ae4529408335cb2257cbfe49 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 13 Apr 2023 16:38:22 +0300 Subject: [PATCH 49/49] Qt: Properly convert client common sort result to Qt sort result Reported by bard See osdn #47856 Signed-off-by: Marko Lindqvist --- client/gui-qt/plrdlg.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/gui-qt/plrdlg.cpp b/client/gui-qt/plrdlg.cpp index e7598267b2..3d89f4fd60 100644 --- a/client/gui-qt/plrdlg.cpp +++ b/client/gui-qt/plrdlg.cpp @@ -347,7 +347,9 @@ bool plr_sorter::lessThan(const QModelIndex &left, } } players_iterate_end; - return column->sort_func(lplr, rplr); + // Convert three-state (left better, equal, right better) + // return from sort_func() to lessThan() boolean + return column->sort_func(lplr, rplr) < 0; } // Use default sort when no sort function defined -- 2.39.2