From 85dc262ae9ec9413f8172a2a8442d6d9134d02f4 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 14 Aug 2023 18:13:29 +0100 Subject: gentoo auto-resync : 14:08:2023 - 18:13:29 --- ....27.7-sensors-correctly-handle-return-val.patch | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 kde-plasma/libksysguard/files/libksysguard-5.27.7-sensors-correctly-handle-return-val.patch (limited to 'kde-plasma/libksysguard/files') diff --git a/kde-plasma/libksysguard/files/libksysguard-5.27.7-sensors-correctly-handle-return-val.patch b/kde-plasma/libksysguard/files/libksysguard-5.27.7-sensors-correctly-handle-return-val.patch new file mode 100644 index 000000000000..599648228272 --- /dev/null +++ b/kde-plasma/libksysguard/files/libksysguard-5.27.7-sensors-correctly-handle-return-val.patch @@ -0,0 +1,36 @@ +From bf2685a3628f213e930743676a6d713e630c6a59 Mon Sep 17 00:00:00 2001 +From: Maciej Stanczew +Date: Sun, 6 Aug 2023 20:23:01 +0200 +Subject: [PATCH] sensors: Correctly handle the return value of + QCollator::compare + +QCollator::compare() can return any integer, not just [-1, 0, 1]. +Comparing the result with -1 happened to work with most locales, +but it broke with the C locale. As a result, when sensors were put +into std::map, they were sometimes erroneously treated as duplicates, +leading to a randomly incomplete and garbled sensor list. + +BUG: 461070 + + +(cherry picked from commit 0a7efca4b331eb9619a2a88fe9093cbbbd351b6e) +--- + sensors/SensorTreeModel.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sensors/SensorTreeModel.cpp b/sensors/SensorTreeModel.cpp +index 6f318035..8487730b 100644 +--- a/sensors/SensorTreeModel.cpp ++++ b/sensors/SensorTreeModel.cpp +@@ -44,7 +44,7 @@ struct Compare { + collator->setCaseSensitivity(Qt::CaseInsensitive); + } + +- return collator->compare(first, second) == -1; ++ return collator->compare(first, second) < 0; + } + + // This uses thread-local storage because QCollator may not be thread safe. +-- +GitLab + -- cgit v1.2.3