upgrade to version 5.5.90

(cherry picked from commit 08655e0e5a6000e8e4ff9cda91fa8c3bb556db85)
This commit is contained in:
leeffo 2023-07-31 16:02:38 +08:00 committed by openeuler-sync-bot
parent 769e773464
commit d050102fbf
4 changed files with 232 additions and 10 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

Binary file not shown.

Binary file not shown.

View File

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