!57 sync with master
From: @dou33 Reviewed-by: @tanyulong2021 Signed-off-by: @tanyulong2021
This commit is contained in:
commit
7754bf865e
68
0013-cpuinfo-in-arm-system-is-null.patch
Normal file
68
0013-cpuinfo-in-arm-system-is-null.patch
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
From b225b7a8b8cb4421fcfa81e4fc985bcf6ec1c59d Mon Sep 17 00:00:00 2001
|
||||||
|
From: peijiankang <peijiankang@kylinos.cn>
|
||||||
|
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 <QFile>
|
||||||
|
#include <QDebug>
|
||||||
|
-
|
||||||
|
+#include <QProcess>
|
||||||
|
#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
|
||||||
|
|
||||||
64
0014-modify-the-error-of-ukui-control-center-open.patch
Normal file
64
0014-modify-the-error-of-ukui-control-center-open.patch
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
From cd42ab432e63ec38e0339c9d075499b2b628db7b Mon Sep 17 00:00:00 2001
|
||||||
|
From: pei-jiankang <peijiankang@kylinos.cn>
|
||||||
|
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
|
||||||
|
|
||||||
12
fix_user_passwd_valid_issue.patch
Normal file
12
fix_user_passwd_valid_issue.patch
Normal file
@ -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);
|
||||||
@ -1,11 +1,12 @@
|
|||||||
%define debug_package %{nil}
|
%define debug_package %{nil}
|
||||||
Name: ukui-control-center
|
Name: ukui-control-center
|
||||||
Version: 3.0.1
|
Version: 3.0.1
|
||||||
Release: 17
|
Release: 20
|
||||||
Summary: utilities to configure the UKUI desktop
|
Summary: utilities to configure the UKUI desktop
|
||||||
License: GPL-2+
|
License: GPL-2+
|
||||||
URL: http://www.ukui.org
|
URL: http://www.ukui.org
|
||||||
Source0: %{name}-%{version}.tar.gz
|
Source0: %{name}-%{version}.tar.gz
|
||||||
|
Source1: ukui-group-manager.desktop
|
||||||
|
|
||||||
BuildRequires: qt5-qtsvg-devel
|
BuildRequires: qt5-qtsvg-devel
|
||||||
BuildRequires: qt5-qtbase-devel
|
BuildRequires: qt5-qtbase-devel
|
||||||
@ -86,6 +87,9 @@ patch13: 0001-fix-compile-extern-C-error.patch
|
|||||||
patch14: fix_arm_root_user_crash.patch
|
patch14: fix_arm_root_user_crash.patch
|
||||||
patch15: fix_add_group_failed_issue.patch
|
patch15: fix_add_group_failed_issue.patch
|
||||||
patch16: fix_user_passwd_valid_time_setting_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
|
Recommends: qt5-qtquickcontrols
|
||||||
|
|
||||||
@ -123,6 +127,9 @@ Suggests: ukui-settings-daemon
|
|||||||
%patch14 -p1
|
%patch14 -p1
|
||||||
%patch15 -p1
|
%patch15 -p1
|
||||||
%patch16 -p1
|
%patch16 -p1
|
||||||
|
%patch17 -p1
|
||||||
|
%patch18 -p1
|
||||||
|
%patch19 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
qmake-qt5
|
qmake-qt5
|
||||||
@ -132,6 +139,9 @@ make
|
|||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
make INSTALL_ROOT=%{buildroot} install
|
make INSTALL_ROOT=%{buildroot} install
|
||||||
|
|
||||||
|
mkdir -p %{buildroot}/etc/xdg/autostart/
|
||||||
|
cp -r %{SOURCE1} %{buildroot}/etc/xdg/autostart/
|
||||||
|
|
||||||
%post
|
%post
|
||||||
set -e
|
set -e
|
||||||
glib-compile-schemas /usr/share/glib-2.0/schemas/
|
glib-compile-schemas /usr/share/glib-2.0/schemas/
|
||||||
@ -139,14 +149,6 @@ glib-compile-schemas /usr/share/glib-2.0/schemas/
|
|||||||
chown root:root /usr/bin/checkuserpwd
|
chown root:root /usr/bin/checkuserpwd
|
||||||
chmod u+s /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
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
@ -166,8 +168,18 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%{_bindir}/checkuserpwd
|
%{_bindir}/checkuserpwd
|
||||||
%{_unitdir}/ukui-group-manager.service
|
%{_unitdir}/ukui-group-manager.service
|
||||||
%{_datadir}/polkit-1/actions/org.ukui.groupmanager.policy
|
%{_datadir}/polkit-1/actions/org.ukui.groupmanager.policy
|
||||||
|
%{_sysconfdir}/xdg/autostart/ukui-group-manager.desktop
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Oct 19 2021 peijiankang <peijiankang@kylinos.cn> - 3.0.1-20
|
||||||
|
- add 0014-modify-the-error-of-ukui-control-center-open.patch
|
||||||
|
|
||||||
|
* Thu Sep 16 2021 douyan <douyan@kylinos.cn> - 3.0.1-19
|
||||||
|
- add fix_user_passwd_valid_issue.patch
|
||||||
|
|
||||||
|
* Sat Sep 11 2021 peijiankang <peijiankang@kylinos.cn> - 3.0.1-18
|
||||||
|
- add 0013-cpuinfo-in-arm-system-is-null.patch
|
||||||
|
|
||||||
* Mon Sep 6 2021 douyan <douyan@kylinos.cn> - 3.0.1-17
|
* Mon Sep 6 2021 douyan <douyan@kylinos.cn> - 3.0.1-17
|
||||||
- add fix_user_passwd_valid_time_setting_failed_issue.patch
|
- add fix_user_passwd_valid_time_setting_failed_issue.patch
|
||||||
|
|
||||||
|
|||||||
18
ukui-group-manager.desktop
Normal file
18
ukui-group-manager.desktop
Normal file
@ -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
|
||||||
|
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user