修复用户头像设置默认头像时未及时更新绘制(#I61QHP)

This commit is contained in:
liuxinhao 2022-11-18 14:39:12 +08:00
parent 0e4f0e875d
commit fb701cca13
2 changed files with 50 additions and 1 deletions

View File

@ -0,0 +1,44 @@
From d80a8b3b5dc5ddf841474ce1fd3024483e6adb9b Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Fri, 18 Nov 2022 13:45:49 +0800
Subject: [PATCH] fix(user icon): fix the failure to update the drawing in time
when setting the default avatar
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复用户头像设置默认头像时未及时更新绘制
---
lib/common-widgets/user-avatar.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/common-widgets/user-avatar.cpp b/lib/common-widgets/user-avatar.cpp
index 9394818..7869569 100644
--- a/lib/common-widgets/user-avatar.cpp
+++ b/lib/common-widgets/user-avatar.cpp
@@ -18,6 +18,7 @@
#include <QFile>
#include <QPainter>
#include <QPainterPath>
+#include <QApplication>
#define DEFAULT_USER_AVATAR ":/common-widgets-images/user_180.png"
@@ -81,7 +82,7 @@ QPixmap UserAvatar::scalePixmapAdjustSize (const QPixmap &pixmap)
QPixmap temp = pixmap.scaled(radius * 2, radius * 2, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation);
return temp;
}
-#include <QApplication>
+
void UserAvatar::setDefaultImage ()
{
if (!m_pixmap.load(DEFAULT_USER_AVATAR))
@@ -90,4 +91,5 @@ void UserAvatar::setDefaultImage ()
return;
}
m_scaledPixmap = scalePixmapAdjustSize(m_pixmap);
+ update();
}
--
2.33.0

View File

@ -1,12 +1,14 @@
Name: kiran-session-guard
Version: 2.4.0
Release: 2
Release: 3
Summary: Kiran desktop environment login and lock screen dialog
Summary(zh_CN): Kiran桌面环境登录和解锁框
License: MulanPSL-2.0
Source0: %{name}-%{version}.tar.gz
Patch01: 0001-fix-CVE-PAM-authorization-bypass-due-to-incorrect-us.patch
Patch02: 0001-fix-user-icon-fix-the-failure-to-update-the-drawing-.patch
%define SHOW_VIRTUAL_KEYBOARD 0
@ -134,6 +136,9 @@ gtk-update-icon-cache -f /usr/share/icons/hicolor/
rm -rf %{buildroot}
%changelog
* Fri Nov 18 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.4.0-3
- KYOS-F: fix the failure to update the drawing in time when setting the default avatar(#I61QHP)
* Mon Nov 14 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.4.0-2
- KYOS-F: fix PAM authorization bypass due to incorrect usage