!26 回合SP3版本代码

From: @lvgenggeng 
Reviewed-by: @xzyangha 
Signed-off-by: @xzyangha
This commit is contained in:
openeuler-ci-bot 2024-06-20 07:43:03 +00:00 committed by Gitee
commit bda16c3da3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
6 changed files with 232 additions and 83 deletions

View File

@ -0,0 +1,202 @@
From a8a0810d6966af7c212261444fe04bb3aafc6251 Mon Sep 17 00:00:00 2001
From: uos <uos@localhost.localdomain>
Date: Wed, 5 Jul 2023 17:05:31 +0800
Subject: [PATCH] fix-lastLogoutUser-root-bug
---
src/dde-lock/lockworker.cpp | 2 -
src/lightdm-deepin-greeter/greeterworker.cpp | 2 -
src/session-widgets/authinterface.cpp | 16 --------
src/session-widgets/authinterface.h | 1 -
src/session-widgets/sessionbasemodel.cpp | 42 +++-----------------
src/session-widgets/sessionbasemodel.h | 4 --
6 files changed, 6 insertions(+), 61 deletions(-)
diff --git a/src/dde-lock/lockworker.cpp b/src/dde-lock/lockworker.cpp
index 7edeaf7..22e798b 100644
--- a/src/dde-lock/lockworker.cpp
+++ b/src/dde-lock/lockworker.cpp
@@ -81,7 +81,6 @@ void LockWorker::initConnections()
m_model->updateCurrentUser(m_lockInter->CurrentUser());
}
});
- connect(m_loginedInter, &LoginedInter::LastLogoutUserChanged, m_model, static_cast<void (SessionBaseModel::*)(const uid_t)>(&SessionBaseModel::updateLastLogoutUser));
connect(m_loginedInter, &LoginedInter::UserListChanged, m_model, &SessionBaseModel::updateLoginedUserList);
/* com.deepin.daemon.Authenticate */
connect(m_authFramework, &DeepinAuthFramework::FramworkStateChanged, m_model, &SessionBaseModel::updateFrameworkState);
@@ -199,7 +198,6 @@ void LockWorker::initData()
{
/* com.deepin.daemon.Accounts */
m_model->updateUserList(m_accountsInter->userList());
- m_model->updateLastLogoutUser(m_loginedInter->lastLogoutUser());
m_model->updateLoginedUserList(m_loginedInter->userList());
/* com.deepin.udcp.iam */
diff --git a/src/lightdm-deepin-greeter/greeterworker.cpp b/src/lightdm-deepin-greeter/greeterworker.cpp
index 915fce2..65bc331 100644
--- a/src/lightdm-deepin-greeter/greeterworker.cpp
+++ b/src/lightdm-deepin-greeter/greeterworker.cpp
@@ -120,7 +120,6 @@ void GreeterWorker::initConnections()
m_soundPlayerInter->PrepareShutdownSound(static_cast<int>(m_model->currentUser()->uid()));
}
});
- connect(m_loginedInter, &LoginedInter::LastLogoutUserChanged, m_model, static_cast<void (SessionBaseModel::*)(const uid_t)>(&SessionBaseModel::updateLastLogoutUser));
connect(m_loginedInter, &LoginedInter::UserListChanged, m_model, &SessionBaseModel::updateLoginedUserList);
/* com.deepin.daemon.Authenticate */
connect(m_authFramework, &DeepinAuthFramework::FramworkStateChanged, m_model, &SessionBaseModel::updateFrameworkState);
@@ -257,7 +256,6 @@ void GreeterWorker::initData()
/* com.deepin.daemon.Accounts */
m_model->updateUserList(m_accountsInter->userList());
- m_model->updateLastLogoutUser(m_loginedInter->lastLogoutUser());
m_model->updateLoginedUserList(m_loginedInter->userList());
/* com.deepin.udcp.iam */
diff --git a/src/session-widgets/authinterface.cpp b/src/session-widgets/authinterface.cpp
index ad8b661..38f1005 100644
--- a/src/session-widgets/authinterface.cpp
+++ b/src/session-widgets/authinterface.cpp
@@ -92,7 +92,6 @@ void AuthInterface::onUserRemove(const QString &user)
void AuthInterface::initData()
{
onUserListChanged(m_accountsInter->userList());
- onLastLogoutUserChanged(m_loginedInter->lastLogoutUser());
onLoginUserListChanged(m_loginedInter->userList());
// m_accountsInter->userList();
// m_loginedInter->lastLogoutUser();
@@ -110,24 +109,9 @@ void AuthInterface::initDBus()
connect(m_accountsInter, &AccountsInter::UserAdded, this, &AuthInterface::onUserAdded, Qt::QueuedConnection);
connect(m_accountsInter, &AccountsInter::UserDeleted, this, &AuthInterface::onUserRemove, Qt::QueuedConnection);
- connect(m_loginedInter, &LoginedInter::LastLogoutUserChanged, this, &AuthInterface::onLastLogoutUserChanged);
connect(m_loginedInter, &LoginedInter::UserListChanged, this, &AuthInterface::onLoginUserListChanged);
}
-void AuthInterface::onLastLogoutUserChanged(uint uid)
-{
- m_lastLogoutUid = uid;
-
- QList<std::shared_ptr<User>> userList = m_model->userList();
- for (auto it = userList.constBegin(); it != userList.constEnd(); ++it) {
- if ((*it)->uid() == uid) {
- m_model->updateLastLogoutUser((*it));
- return;
- }
- }
-
- m_model->updateLastLogoutUser(std::shared_ptr<User>(nullptr));
-}
void AuthInterface::onLoginUserListChanged(const QString &list)
{
diff --git a/src/session-widgets/authinterface.h b/src/session-widgets/authinterface.h
index d01afe1..3fc1fe8 100644
--- a/src/session-widgets/authinterface.h
+++ b/src/session-widgets/authinterface.h
@@ -54,7 +54,6 @@ public:
protected:
void initDBus();
void initData();
- void onLastLogoutUserChanged(uint uid);
void onLoginUserListChanged(const QString &list);
bool checkHaveDisplay(const QJsonArray &array);
diff --git a/src/session-widgets/sessionbasemodel.cpp b/src/session-widgets/sessionbasemodel.cpp
index 9593db3..f8a43de 100644
--- a/src/session-widgets/sessionbasemodel.cpp
+++ b/src/session-widgets/sessionbasemodel.cpp
@@ -31,7 +31,6 @@ SessionBaseModel::SessionBaseModel(QObject *parent)
, m_isUseWayland(QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive))
, m_appType(AuthCommon::None)
, m_currentUser(nullptr)
- , m_lastLogoutUser(nullptr)
, m_powerAction(PowerAction::RequireNormal)
, m_currentModeState(ModeStatus::NoStatus)
, m_authProperty {false, false, Unavailable, AuthCommon::None, AuthCommon::None, 0, "", "", ""}
@@ -385,8 +384,12 @@ bool SessionBaseModel::updateCurrentUser(const QString &userJson)
qDebug("update current user, data: %s", qPrintable(userJson));
std::shared_ptr<User> user_ptr = json2User(userJson);
- if (!user_ptr)
- user_ptr = m_lastLogoutUser ? m_lastLogoutUser : m_users->first();
+ if (!user_ptr) {
+ if (m_currentUser)
+ return false;
+
+ user_ptr = m_users->first();
+ }
return updateCurrentUser(user_ptr);
}
@@ -439,39 +442,6 @@ void SessionBaseModel::updateUserList(const QStringList &list)
}
emit userListChanged(m_users->values());
}
-
-/**
- * @brief 更新上一个登录用户
- *
- * @param uid
- */
-void SessionBaseModel::updateLastLogoutUser(const uid_t uid)
-{
- qDebug() << "SessionBaseModel::updateLastLogoutUser:" << uid;
- QList<std::shared_ptr<User>> userList = m_users->values();
- auto it = std::find_if(userList.begin(), userList.end(), [uid](std::shared_ptr<User> &user) {
- return user->uid() == uid;
- });
- if (it != userList.end()) {
- updateLastLogoutUser(it.i->t());
- }
-}
-
-/**
- * @brief 设置上一个登录的用户
- *
- * @param lastLogoutUser
- */
-void SessionBaseModel::updateLastLogoutUser(const std::shared_ptr<User> lastLogoutUser)
-{
- if (!lastLogoutUser.get() || m_lastLogoutUser == lastLogoutUser) {
- return;
- }
- qInfo() << "last logout user:" << lastLogoutUser->name() << lastLogoutUser->uid();
-
- m_lastLogoutUser = lastLogoutUser;
-}
-
/**
* @brief 更新已登录用户列表
*
diff --git a/src/session-widgets/sessionbasemodel.h b/src/session-widgets/sessionbasemodel.h
index 09e35f4..5e57249 100644
--- a/src/session-widgets/sessionbasemodel.h
+++ b/src/session-widgets/sessionbasemodel.h
@@ -70,7 +70,6 @@ public:
~SessionBaseModel() override;
inline std::shared_ptr<User> currentUser() const { return m_currentUser; }
- inline std::shared_ptr<User> lastLogoutUser() const { return m_lastLogoutUser; }
inline QList<std::shared_ptr<User>> loginedUserList() const { return m_loginedUsers->values(); }
inline QList<std::shared_ptr<User>> userList() const { return m_users->values(); }
@@ -165,8 +164,6 @@ public slots:
bool updateCurrentUser(const QString &userJson);
bool updateCurrentUser(const std::shared_ptr<User> user);
void updateUserList(const QStringList &list);
- void updateLastLogoutUser(const uid_t uid);
- void updateLastLogoutUser(const std::shared_ptr<User> lastLogoutUser);
void updateLoginedUserList(const QString &list);
/* com.deepin.daemon.Authenticate */
void updateLimitedInfo(const QString &info);
@@ -236,7 +233,6 @@ private:
AppType m_appType;
QList<std::shared_ptr<User>> m_userList;
std::shared_ptr<User> m_currentUser;
- std::shared_ptr<User> m_lastLogoutUser;
QString m_sessionKey;
PowerAction m_powerAction;
ModeStatus m_currentModeState;
--
2.27.0

View File

@ -1,36 +0,0 @@
# dde-session-shell
#### Description
dde session shell
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

View File

@ -1,37 +0,0 @@
# dde-session-shell
#### 介绍
dde session shell
#### 软件架构
软件架构说明
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 码云特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

Binary file not shown.

Binary file not shown.

View File

@ -1,10 +1,11 @@
Name: dde-session-shell
Version: 5.4.92
Version: 5.5.90
Release: 1
Summary: deepin-session-shell - Deepin desktop-environment - session-shell module
License: GPLv3+
URL: http://shuttle.corp.deepin.com/cache/repos/eagle/release-candidate/RERFNS4wLjAuNzYxMA/pool/main/d/dde-session-shell/
Source0: %{name}-%{version}.orig.tar.xz
URL: https://github.com/linuxdeepin/dde-session-shell
Source0: %{name}-%{version}.tar.gz
Patch0: 9000-fix-lastLogoutUser-root-bug.patch
BuildRequires: cmake
BuildRequires: dde-daemon
@ -26,6 +27,8 @@ BuildRequires: lightdm-qt5-devel
BuildRequires: pam-devel
BuildRequires: gtest-devel gmock
BuildRequires: openssl-devel
BuildRequires: dtkgui-devel
BuildRequires: kf5-kwayland-devel
Requires: lightdm
Requires(post): sed
@ -35,14 +38,23 @@ Provides: lightdm-greeter = 1.2
%description
deepin-session-shell - Deepin desktop-environment - session-shell module.
%package devel
Summary: Development package for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
Header files for %{name}.
%prep
%setup -q -n %{name}-%{version}
%setup -q
%patch0 -p1
%build
export PATH=$PATH:%{_qt5_bindir}
cmake_version=$(cmake --version | head -1 | awk '{print $3}')
sed -i "s|VERSION 3.13.4|VERSION $cmake_version|g" CMakeLists.txt
%cmake
%cmake -DCMAKE_INSTALL_SYSCONFDIR=/etc
%make_build
%install
@ -52,19 +64,27 @@ sed -i "s|VERSION 3.13.4|VERSION $cmake_version|g" CMakeLists.txt
%{_bindir}/dde-lock
%{_bindir}/lightdm-deepin-greeter
%attr(755,root,root) %{_bindir}/deepin-greeter
%{_sysconfdir}/deepin/greeters.d/00-xrandr
%{_sysconfdir}/deepin/greeters.d/lightdm-deepin-greeter
%{_sysconfdir}/deepin/
%{_sysconfdir}/lightdm/deepin/
%{_sysconfdir}/xdg/autostart/dde-lock.desktop
%{_datadir}/dde-session-shell/
%{_sysconfdir}/deepin/greeters.d/10-cursor-theme
%{_datadir}/deepin-authentication/privileges/lightdm-deepin-greeter.conf
%{_datadir}/xgreeters/lightdm-deepin-greeter.desktop
%{_datadir}/dbus-1/services/com.deepin.dde.lockFront.service
%{_datadir}/dbus-1/services/com.deepin.dde.shutdownFront.service
%{_datadir}/applications/dde-lock.desktop
%{_datadir}/glib-2.0/schemas/com.deepin.dde.session-shell.gschema.xml
%{_datadir}/deepin-authentication/privileges/lightdm-deepin-greeter.conf
%{_datadir}/dsg
%files devel
%{_includedir}/%{name}
%{_prefix}/lib/%{name}/modules/
%{_libdir}/cmake/DdeSessionShell/DdeSessionShellConfig.cmake
%changelog
* Wed Jun 19 2024 lvgenggeng <lvgenggeng@uniontech.com> - 5.5.90-1
- upgrade to version 5.5.90
* Thu Mar 30 2023 liweiganga <liweiganga@uniontech.com> - 5.4.92-1
- update: update to 5.4.92