summaryrefslogtreecommitdiff
path: root/kde-plasma/libksysguard/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-08-14 18:13:29 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-08-14 18:13:29 +0100
commit85dc262ae9ec9413f8172a2a8442d6d9134d02f4 (patch)
tree81768a8b154fded73a17e9475cebc90d79fd4720 /kde-plasma/libksysguard/files
parentb6323af2602e6a5cd4920d4af06b5c2f3949b9d0 (diff)
gentoo auto-resync : 14:08:2023 - 18:13:29
Diffstat (limited to 'kde-plasma/libksysguard/files')
-rw-r--r--kde-plasma/libksysguard/files/libksysguard-5.27.7-sensors-correctly-handle-return-val.patch36
1 files changed, 36 insertions, 0 deletions
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 <maciej.stanczew@gmail.com>
+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
+