From 9a05d05d970c5166597df2f23a2bc1c457a9f208 Mon Sep 17 00:00:00 2001 From: peijiankang Date: Tue, 28 May 2024 15:14:47 +0800 Subject: [PATCH] update-formats_loacle-and-language --- ukui-control-center.spec | 10 +++++++- update-formats_loacle-and-language.patch | 29 ++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 update-formats_loacle-and-language.patch diff --git a/ukui-control-center.spec b/ukui-control-center.spec index d700d9a..75d6a9d 100644 --- a/ukui-control-center.spec +++ b/ukui-control-center.spec @@ -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 - 3.1.2-27 +- Type:bugfix +- ID :NA +- SUG :NA +- DESC:add update-formats_loacle-and-language.patch + * Fri Sep 15 2023 peijiankang - 3.1.2-26 - Type:bugfix - ID:NA diff --git a/update-formats_loacle-and-language.patch b/update-formats_loacle-and-language.patch new file mode 100644 index 0000000..81d370f --- /dev/null +++ b/update-formats_loacle-and-language.patch @@ -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 +