summaryrefslogtreecommitdiff
path: root/kde-frameworks/kio/files/kio-5.77.0-fix-default-codec-not-usascii-1.patch
diff options
context:
space:
mode:
Diffstat (limited to 'kde-frameworks/kio/files/kio-5.77.0-fix-default-codec-not-usascii-1.patch')
-rw-r--r--kde-frameworks/kio/files/kio-5.77.0-fix-default-codec-not-usascii-1.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/kde-frameworks/kio/files/kio-5.77.0-fix-default-codec-not-usascii-1.patch b/kde-frameworks/kio/files/kio-5.77.0-fix-default-codec-not-usascii-1.patch
new file mode 100644
index 000000000000..8f589b796aa5
--- /dev/null
+++ b/kde-frameworks/kio/files/kio-5.77.0-fix-default-codec-not-usascii-1.patch
@@ -0,0 +1,36 @@
+From 0a13e0a3e830be2b2b2e5c2c6cf8cef25bd68bd8 Mon Sep 17 00:00:00 2001
+From: Tusooa Zhu <tusooa@vista.aero>
+Date: Thu, 4 Feb 2021 08:36:26 -0500
+Subject: [PATCH] Fix default codec being set to "US-ASCII" in KIO apps
+
+From https://doc.qt.io/qt-5/qloggingcategory.html#Q_LOGGING_CATEGORY-1 :
+"The implicitly-defined QLoggingCategory object is created on first use,
+in a thread-safe manner."
+
+The original way to explicitly define a static QLoggingCategory will lead
+to a call to ucnv_getDefaultName() before QApplication constructor (where
+setlocale() is called), thus making QTextCodec::codecForLocale() misbehave.
+Here we replace the explicit definition with the Q_LOGGING_CATEGORY macro,
+and thus avoid this problem.
+
+BUG: 432406
+---
+ src/widgets/kdirmodel.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/widgets/kdirmodel.cpp b/src/widgets/kdirmodel.cpp
+index a48ab462..aa049e3d 100644
+--- a/src/widgets/kdirmodel.cpp
++++ b/src/widgets/kdirmodel.cpp
+@@ -36,7 +36,7 @@
+ #include <qt_windows.h>
+ #endif
+
+-static QLoggingCategory category("kf.kio.widgets.kdirmodel", QtInfoMsg);
++Q_LOGGING_CATEGORY(category, "kf.kio.widgets.kdirmodel", QtInfoMsg)
+
+ class KDirModelNode;
+ class KDirModelDirNode;
+--
+GitLab
+