From 4829849dea8056eb79b5a7860a3ef63f6e519f87 Mon Sep 17 00:00:00 2001 From: peijiankang Date: Sat, 11 Sep 2021 15:37:18 +0800 Subject: [PATCH 1/3] add 0013-cpuinfo-in-arm-system-is-null.patch --- 0013-cpuinfo-in-arm-system-is-null.patch | 68 ++++++++++++++++++++++++ ukui-control-center.spec | 7 ++- 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 0013-cpuinfo-in-arm-system-is-null.patch diff --git a/0013-cpuinfo-in-arm-system-is-null.patch b/0013-cpuinfo-in-arm-system-is-null.patch new file mode 100644 index 0000000..efcd6ef --- /dev/null +++ b/0013-cpuinfo-in-arm-system-is-null.patch @@ -0,0 +1,68 @@ +From b225b7a8b8cb4421fcfa81e4fc985bcf6ec1c59d Mon Sep 17 00:00:00 2001 +From: peijiankang +Date: Sat, 11 Sep 2021 15:29:44 +0800 +Subject: [PATCH] cpuinfo in arm system is null + +--- + plugins/messages-task/about/cpuinfo.cpp | 37 +++++++++++++------------ + 1 file changed, 19 insertions(+), 18 deletions(-) + +diff --git a/plugins/messages-task/about/cpuinfo.cpp b/plugins/messages-task/about/cpuinfo.cpp +index ee24a95..d208453 100644 +--- a/plugins/messages-task/about/cpuinfo.cpp ++++ b/plugins/messages-task/about/cpuinfo.cpp +@@ -1,6 +1,6 @@ + #include + #include +- ++#include + #include "cpuinfo.h" + + cpuinfo::cpuinfo(QObject *parent) : QObject(parent) +@@ -10,25 +10,26 @@ cpuinfo::cpuinfo(QObject *parent) : QObject(parent) + + QString cpuinfo::getCpuName() + { +- QString name = ""; ++ QString name = ""; + #ifdef Q_OS_LINUX +- QFile file("/proc/cpuinfo"); +- if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) +- return "no cpuinfo"; ++ QProcess process; ++ process.start("lscpu"); ++ process.waitForFinished(); ++ QString output = process.readAll(); ++ QStringList outputlist = output.split("\n"); + +- QString line = "N/A"; +- QTextStream in(&file); +- line = in.readLine(); +- while (!in.atEnd()) { +- line = in.readLine(); +- if (line.contains("model name")) +- break; +- } +- //openEuler /proc/cpuinfo +- //model name : Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz +- name = QString(line).right(line.length() - (line.indexOf(":") + 2)); ++ for (QString str : outputlist) { ++ if (str.contains("型号名称")){ ++ name = QString(str).right(str.length() - 28); ++ break; ++ } ++ else if(str.contains("Model name")) { ++ name = QString(str).right(str.length() - 33); ++ break; ++ } ++ } + #elif defined(Q_OS_FREEBSD) + + #endif +- return name; +-} ++ return name; ++} +-- +2.30.0 + diff --git a/ukui-control-center.spec b/ukui-control-center.spec index 9906824..7f6e048 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: 17 +Release: 18 Summary: utilities to configure the UKUI desktop License: GPL-2+ URL: http://www.ukui.org @@ -86,6 +86,7 @@ patch13: 0001-fix-compile-extern-C-error.patch patch14: fix_arm_root_user_crash.patch 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 Recommends: qt5-qtquickcontrols @@ -123,6 +124,7 @@ Suggests: ukui-settings-daemon %patch14 -p1 %patch15 -p1 %patch16 -p1 +%patch17 -p1 %build qmake-qt5 @@ -168,6 +170,9 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/polkit-1/actions/org.ukui.groupmanager.policy %changelog +* Sat Sep 11 2021 peijiankang - 3.0.1-18 +- add 0013-cpuinfo-in-arm-system-is-null.patch + * Mon Sep 6 2021 douyan - 3.0.1-17 - add fix_user_passwd_valid_time_setting_failed_issue.patch From ebe01f2fcdebeeaa1aca45ad50926b024d174c19 Mon Sep 17 00:00:00 2001 From: dou33 Date: Thu, 16 Sep 2021 18:08:33 +0800 Subject: [PATCH 2/3] fix user passwd valid issue --- fix_user_passwd_valid_issue.patch | 12 ++++++++++++ ukui-control-center.spec | 20 +++++++++++--------- ukui-group-manager.desktop | 18 ++++++++++++++++++ 3 files changed, 41 insertions(+), 9 deletions(-) create mode 100644 fix_user_passwd_valid_issue.patch create mode 100644 ukui-group-manager.desktop diff --git a/fix_user_passwd_valid_issue.patch b/fix_user_passwd_valid_issue.patch new file mode 100644 index 0000000..f401dcd --- /dev/null +++ b/fix_user_passwd_valid_issue.patch @@ -0,0 +1,12 @@ +diff -Naur ukui-control-center-3.0.1/plugins/account/userinfo/changevaliddialog.cpp ukui-control-center-3.0.1~/plugins/account/userinfo/changevaliddialog.cpp +--- ukui-control-center-3.0.1/plugins/account/userinfo/changevaliddialog.cpp 2021-09-16 15:20:36.911428472 +0800 ++++ ukui-control-center-3.0.1~/plugins/account/userinfo/changevaliddialog.cpp 2021-09-16 15:24:43.754446704 +0800 +@@ -143,7 +143,7 @@ + + void ChangeValidDialog::_getCurrentPwdStatus(){ + // +- QString cmd = "passwd -S " + _name; ++ QString cmd = "pkexec passwd -S " + _name; + + QProcess * process = new QProcess; + process->start(cmd); diff --git a/ukui-control-center.spec b/ukui-control-center.spec index 7f6e048..96ff4b8 100644 --- a/ukui-control-center.spec +++ b/ukui-control-center.spec @@ -1,11 +1,12 @@ %define debug_package %{nil} Name: ukui-control-center Version: 3.0.1 -Release: 18 +Release: 19 Summary: utilities to configure the UKUI desktop License: GPL-2+ URL: http://www.ukui.org Source0: %{name}-%{version}.tar.gz +Source1: ukui-group-manager.desktop BuildRequires: qt5-qtsvg-devel BuildRequires: qt5-qtbase-devel @@ -87,6 +88,7 @@ patch14: fix_arm_root_user_crash.patch 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 Recommends: qt5-qtquickcontrols @@ -125,6 +127,7 @@ Suggests: ukui-settings-daemon %patch15 -p1 %patch16 -p1 %patch17 -p1 +%patch18 -p1 %build qmake-qt5 @@ -134,6 +137,9 @@ make rm -rf $RPM_BUILD_ROOT make INSTALL_ROOT=%{buildroot} install +mkdir -p %{buildroot}/etc/xdg/autostart/ +cp -r %{SOURCE1} %{buildroot}/etc/xdg/autostart/ + %post set -e glib-compile-schemas /usr/share/glib-2.0/schemas/ @@ -141,14 +147,6 @@ glib-compile-schemas /usr/share/glib-2.0/schemas/ chown root:root /usr/bin/checkuserpwd chmod u+s /usr/bin/checkuserpwd -%systemd_post ukui-group-manager.service - -%preun -%systemd_preun ukui-group-manager.service - -%postun -%systemd_postun ukui-group-manager.service - %clean rm -rf $RPM_BUILD_ROOT @@ -168,8 +166,12 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/checkuserpwd %{_unitdir}/ukui-group-manager.service %{_datadir}/polkit-1/actions/org.ukui.groupmanager.policy +%{_sysconfdir}/xdg/autostart/ukui-group-manager.desktop %changelog +* Thu Sep 16 2021 douyan - 3.0.1-19 +- add fix_user_passwd_valid_issue.patch + * Sat Sep 11 2021 peijiankang - 3.0.1-18 - add 0013-cpuinfo-in-arm-system-is-null.patch diff --git a/ukui-group-manager.desktop b/ukui-group-manager.desktop new file mode 100644 index 0000000..3c61dc8 --- /dev/null +++ b/ukui-group-manager.desktop @@ -0,0 +1,18 @@ +[Desktop Entry] +Name=ukui-group-manager +Comment=ukui-group-manager +Exec=/usr/bin/group-manager-server +Terminal=false +Type=Application +Keywords=UKUI; +NoDisplay=true +OnlyShowIn=UKUI; +X-UKUI-Autostart-Phase=Application +X-UKUI-Bugzilla-Bugzilla=UKUI +X-MATE-Autostart-Phase=Applications +X-KDE-autostart-after=panel +X-UKUI-Autostart-Notify=true +X-UKUI-Autostart-Delay=3 +X-UKUI-AutoRestart=true + + From 41b1785d97f93c6f93aa68c3505b395c738898e6 Mon Sep 17 00:00:00 2001 From: pei-jiankang Date: Fri, 15 Oct 2021 14:15:20 +0800 Subject: [PATCH 3/3] add 0014-modify-the-error-of-ukui-control-center-open.patch --- ...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