File 0001-Fix-default-codec-being-set-to-US-ASCII-in-KIO-apps.patch of Package kio

From 072b54e1b5fae0a534c3c7889966393d986146fc Mon Sep 17 00:00:00 2001
From: Tusooa Zhu <tusooa@vista.aero>
Date: Thu, 4 Feb 2021 08:36:26 -0500
Subject: [PATCH 1/3] 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
(cherry picked from commit 0a13e0a3e830be2b2b2e5c2c6cf8cef25bd68bd8)
---
 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 2fd8de7a..53e8fe9b 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;
-- 
2.25.1

openSUSE Build Service is sponsored by