!112 Fix terminal garbled characters

From: @peijiankang 
Reviewed-by: @tanyulong2021 
Signed-off-by: @tanyulong2021
This commit is contained in:
openeuler-ci-bot 2022-10-19 10:30:25 +00:00 committed by Gitee
commit 150b0bc104
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 65 additions and 1 deletions

View File

@ -0,0 +1,59 @@
From 67d91670a337d97b0ceab43ba20c886a50618e90 Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
Date: Tue, 18 Oct 2022 11:27:00 +0800
Subject: [PATCH] Fix terminal garbled characters
---
plugins/time-language/area/area.cpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/plugins/time-language/area/area.cpp b/plugins/time-language/area/area.cpp
index 1c10b4e..35777bc 100644
--- a/plugins/time-language/area/area.cpp
+++ b/plugins/time-language/area/area.cpp
@@ -229,7 +229,7 @@ void Area::initLanguage()
QStringList res = getUserDefaultLanguage();
QString lang = res.at(1);
- int langIndex = lang.split(':').at(0) == "zh_CN" ? 0 : 1;
+ int langIndex = lang.split(':').at(0) == "zh_CN.UTF-8" ? 0 : 1;
if (0 == langIndex) {
chineseFrame->showSelectedIcon(true);
@@ -244,13 +244,13 @@ void Area::initLanguage()
connect(chineseFrame, &LanguageFrame::clicked, this, [=](){
englishFrame->showSelectedIcon(false);
- m_areaInterface->call("SetLanguage","zh_CN");
+ m_areaInterface->call("SetLanguage","zh_CN.UTF-8");
showMessageBox(2);
});
connect(englishFrame, &LanguageFrame::clicked, this, [=](){
chineseFrame->showSelectedIcon(false);
- m_areaInterface->call("SetLanguage","en_US");
+ m_areaInterface->call("SetLanguage","en_US.UTF-8");
showMessageBox(2);
});
}
@@ -261,7 +261,7 @@ void Area::initComponent() {
QStringList res = getUserDefaultLanguage();
QString lang = res.at(1);
- int langIndex = lang.split(':').at(0) == "zh_CN" ? 1 : 0;
+ int langIndex = lang.split(':').at(0) == "zh_CN.UTF-8" ? 1 : 0;
int formatIndex = res.at(0) == "zh_CN.UTF-8" ? 1 : 0;
// ui->langcomboBox->setCurrentIndex(langIndex);
ui->countrycomboBox->setCurrentIndex(langIndex);
@@ -380,7 +380,7 @@ QStringList Area::getUserDefaultLanguage() {
if(language.isEmpty() && propertyMap.keys().contains("Language")) {
language = propertyMap.find("Language").value().toString();
if(language.isEmpty())
- language = QLocale::system().name();
+ language = QLocale::system().name()+ ".UTF-8";
}
} else {
qDebug() << "reply failed";
--
2.36.1

View File

@ -1,7 +1,7 @@
%define debug_package %{nil}
Name: ukui-control-center
Version: 3.0.4
Release: 15
Release: 16
Summary: utilities to configure the UKUI desktop
License: GPL-2+
URL: http://www.ukui.org
@ -16,6 +16,7 @@ Patch07: 0007-modify-icon-theme-not-display.patch
Patch08: 0008-Fix-preferred-language-default-errors.patch
Patch09: 0009-Fix-the-resolution-donotsave-button-fails.patch
Patch10: 0010-Fix-the-problem-of-scrambled-shortcut-keys.patch
Patch11: 0011-Fix-terminal-garbled-characters.patch
BuildRequires: qt5-qtsvg-devel
BuildRequires: qt5-qtbase-devel
@ -123,6 +124,7 @@ Suggests: ukui-settings-daemon
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%build
qmake-qt5
@ -171,6 +173,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Tue Oct 18 2022 peijiankang <peijiankang@kylinos.cn> - 3.0.4-16
- Fix terminal garbled characters
* Mon Aug 15 2022 peijiankang <peijiankang@kylinos.cn> - 3.0.4-15
- Fix the problem of scrambled shortcut keys