From cf6fb499a2fbeb4d739d83d66c33dd65e2211f96 Mon Sep 17 00:00:00 2001 From: pei-jiankang Date: Fri, 15 Oct 2021 14:15:20 +0800 Subject: [PATCH] add 0014-modify-the-error-of-ukui-control-center-open.patch (cherry picked from commit 41b1785d97f93c6f93aa68c3505b395c738898e6) --- ...he-error-of-ukui-control-center-open.patch | 64 +++++++++++++++++++ ukui-control-center.spec | 7 +- 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 0014-modify-the-error-of-ukui-control-center-open.patch diff --git a/0014-modify-the-error-of-ukui-control-center-open.patch b/0014-modify-the-error-of-ukui-control-center-open.patch new file mode 100644 index 0000000..0a126fb --- /dev/null +++ b/0014-modify-the-error-of-ukui-control-center-open.patch @@ -0,0 +1,64 @@ +From cd42ab432e63ec38e0339c9d075499b2b628db7b Mon Sep 17 00:00:00 2001 +From: pei-jiankang +Date: Fri, 15 Oct 2021 14:10:28 +0800 +Subject: [PATCH] modify the error of ukui-control-center open + +--- + plugins/messages-task/about/about.cpp | 5 +++-- + plugins/messages-task/about/cpuinfo.cpp | 5 +++-- + plugins/messages-task/about/memoryentry.cpp | 2 +- + 3 files changed, 7 insertions(+), 5 deletions(-) + +diff --git a/plugins/messages-task/about/about.cpp b/plugins/messages-task/about/about.cpp +index a2dc766..77f99da 100755 +--- a/plugins/messages-task/about/about.cpp ++++ b/plugins/messages-task/about/about.cpp +@@ -106,8 +106,9 @@ void About::setupKernelCompenent() { + + MemoryEntry memoryInfo; + QStringList memory = memoryInfo.totalMemory(); +- memorySize = memory.at(0) + "(" + memory.at(1) + tr(" available") + ")"; +- ++ if(memory.size() >=2) { ++ memorySize = memory.at(0) + "(" + memory.at(1) + tr(" available") + ")"; ++ } + ui->kernalContent->setText(kernal); + ui->memoryContent->setText(memorySize); + +diff --git a/plugins/messages-task/about/cpuinfo.cpp b/plugins/messages-task/about/cpuinfo.cpp +index d208453..0fb1461 100644 +--- a/plugins/messages-task/about/cpuinfo.cpp ++++ b/plugins/messages-task/about/cpuinfo.cpp +@@ -20,14 +20,15 @@ QString cpuinfo::getCpuName() + + for (QString str : outputlist) { + if (str.contains("型号名称")){ +- name = QString(str).right(str.length() - 28); ++ name = QString(str).right(str.length() - (str.indexOf(":") + 1)); + break; + } + else if(str.contains("Model name")) { +- name = QString(str).right(str.length() - 33); ++ name = QString(str).right(str.length() - (str.indexOf(":") + 1)); + break; + } + } ++ name.remove(QRegExp("^ +\\s*")); + #elif defined(Q_OS_FREEBSD) + + #endif +diff --git a/plugins/messages-task/about/memoryentry.cpp b/plugins/messages-task/about/memoryentry.cpp +index f1b1bef..b48b9b7 100755 +--- a/plugins/messages-task/about/memoryentry.cpp ++++ b/plugins/messages-task/about/memoryentry.cpp +@@ -76,6 +76,6 @@ QStringList MemoryEntry::totalMemory() + res << total << available; + return res; + } +- ++ res << "N/A" << "N/A"; + return res; + } +-- +2.27.0 + diff --git a/ukui-control-center.spec b/ukui-control-center.spec index 96ff4b8..7967727 100644 --- a/ukui-control-center.spec +++ b/ukui-control-center.spec @@ -1,7 +1,7 @@ %define debug_package %{nil} Name: ukui-control-center Version: 3.0.1 -Release: 19 +Release: 20 Summary: utilities to configure the UKUI desktop License: GPL-2+ URL: http://www.ukui.org @@ -89,6 +89,7 @@ patch15: fix_add_group_failed_issue.patch patch16: fix_user_passwd_valid_time_setting_failed_issue.patch patch17: 0013-cpuinfo-in-arm-system-is-null.patch patch18: fix_user_passwd_valid_issue.patch +patch19: 0014-modify-the-error-of-ukui-control-center-open.patch Recommends: qt5-qtquickcontrols @@ -128,6 +129,7 @@ Suggests: ukui-settings-daemon %patch16 -p1 %patch17 -p1 %patch18 -p1 +%patch19 -p1 %build qmake-qt5 @@ -169,6 +171,9 @@ rm -rf $RPM_BUILD_ROOT %{_sysconfdir}/xdg/autostart/ukui-group-manager.desktop %changelog +* Tue Oct 19 2021 peijiankang - 3.0.1-20 +- add 0014-modify-the-error-of-ukui-control-center-open.patch + * Thu Sep 16 2021 douyan - 3.0.1-19 - add fix_user_passwd_valid_issue.patch