!193 update-formats_loacle-and-language

From: @peijiankang 
Reviewed-by: @hua_yadong 
Signed-off-by: @hua_yadong
This commit is contained in:
openeuler-ci-bot 2024-05-28 08:43:36 +00:00 committed by Gitee
commit f1544e44de
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 38 additions and 1 deletions

View File

@ -1,6 +1,6 @@
Name: ukui-control-center
Version: 3.1.2
Release: 26
Release: 27
Summary: utilities to configure the UKUI desktop
License: GPL-2+
URL: http://www.ukui.org
@ -26,9 +26,11 @@ Patch21: add-information-for-about.patch
Patch22: cpuinfo-in-arm-system-is-null.patch
Patch23: add-ukcc-setlang.patch
Patch24: fix-changeusertype-error.patch
Patch25: update-formats_loacle-and-language.patch
#Patch200: fix-build-error-of-libkscreen-qt5-5.27.6.patch
Patch201: fix-build-error-of-clang.patch
#Patch202: fix-build-error-of-ddcutil-2.0.0.patch
BuildRequires: qt5-qtsvg-devel
BuildRequires: gsettings-qt-devel
BuildRequires: glib2-devel
@ -149,6 +151,12 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Mon Sep 25 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.2-27
- Type:bugfix
- ID :NA
- SUG :NA
- DESC:add update-formats_loacle-and-language.patch
* Fri Sep 15 2023 peijiankang <peijiankang@kylinos.cn> - 3.1.2-26
- Type:bugfix
- ID:NA

View File

@ -0,0 +1,29 @@
diff --git a/plugins/time-language/area/area.cpp b/plugins/time-language/area/area.cpp
index 5345b36..611bf9d 100644
--- a/plugins/time-language/area/area.cpp
+++ b/plugins/time-language/area/area.cpp
@@ -184,8 +185,7 @@ void Area::initLanguage()
HLineFrame *lineF_2 = new HLineFrame();
QStringList res = getUserDefaultLanguage();
- QString lang = res.at(1);
- int langIndex = lang.split(':').at(0) == "zh_CN.UTF-8" ? 0 : 1;
+ int langIndex= res.at(1).contains("zh_CN", Qt::CaseInsensitive) ? 0 : 1;
if (0 == langIndex) {
chineseFrame->showSelectedIcon(true);
@@ -222,9 +222,8 @@ void Area::initComponent() {
ui->countrycomboBox->addItem(tr("CN"));
QStringList res = getUserDefaultLanguage();
- QString lang = res.at(1);
- int langIndex = lang.split(':').at(0) == "zh_CN.UTF-8" ? 1 : 0;
- int formatIndex = res.at(0) == "zh_CN.UTF-8" ? 1 : 0;
+ int langIndex= res.at(1).contains("zh_CN", Qt::CaseInsensitive) ? 1 : 0;
+ int formatIndex= res.at(0).contains("zh_CN", Qt::CaseInsensitive) ? 1 : 0;
// ui->langcomboBox->setCurrentIndex(langIndex);
ui->countrycomboBox->setCurrentIndex(formatIndex);
--
2.41.0