fix(wallpaper):change the system wallpaper xml search path to kiran,and solve the segmentation fault when system xml not exists
- 修改系统壁纸xml文件搜索路径为kiran,并解决该文件不存在时带来的段错误
This commit is contained in:
parent
38bc78debf
commit
b7a3fc65f7
@ -0,0 +1,29 @@
|
||||
From bb700629b3b1246b8c23be4f0739a46850685eb5 Mon Sep 17 00:00:00 2001
|
||||
From: yuanxing <yuanxing@kylinsec.com.cn>
|
||||
Date: Fri, 25 Aug 2023 10:49:36 +0800
|
||||
Subject: [PATCH] fix(wallpaper):change system wallpaper xml path to kiran
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 修改获取的系统壁纸xml文件路径为kiran
|
||||
---
|
||||
plugins/appearance/src/pages/wallpaper/wallpaper-def.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/plugins/appearance/src/pages/wallpaper/wallpaper-def.h b/plugins/appearance/src/pages/wallpaper/wallpaper-def.h
|
||||
index d27c921..adefaf9 100644
|
||||
--- a/plugins/appearance/src/pages/wallpaper/wallpaper-def.h
|
||||
+++ b/plugins/appearance/src/pages/wallpaper/wallpaper-def.h
|
||||
@@ -30,7 +30,7 @@ enum WallpaperType
|
||||
|
||||
#define SYSTEM_BACKGROUND_PATH "/usr/share/backgrounds/kiran/"
|
||||
#define LOCAL_WALLPAPER_FILE ".config/kylinsec/kiran-cpanel-appearance/wallpaper.xml"
|
||||
-#define SYSTEM_WALLPAPER_FILE "/usr/share/mate-background-properties/kiran_background.xml"
|
||||
+#define SYSTEM_WALLPAPER_FILE "/usr/share/kiran-background-properties/kiran_background.xml"
|
||||
#define CACHE_IMAGE_DIR ".config/kylinsec/kiran-cpanel-appearance/"
|
||||
|
||||
#define FILENAME "filename"
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
From 2dc6afb3447969964b51c3d02986796f0d7bd77d Mon Sep 17 00:00:00 2001
|
||||
From: yuanxing <yuanxing@kylinsec.com.cn>
|
||||
Date: Fri, 25 Aug 2023 13:47:13 +0800
|
||||
Subject: [PATCH] fix(wallpaper):don't call xmlWriter if system background xml
|
||||
not exists to solve segmentation fault
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 当系统系统壁纸xml文件不存在时,不调用xmlWriter函数,防止段错误
|
||||
---
|
||||
.../wallpaper/widget/xml-management/xml-management.cpp | 9 +++++++--
|
||||
1 file changed, 7 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/plugins/appearance/src/pages/wallpaper/widget/xml-management/xml-management.cpp b/plugins/appearance/src/pages/wallpaper/widget/xml-management/xml-management.cpp
|
||||
index 8d174ab..385eb9e 100644
|
||||
--- a/plugins/appearance/src/pages/wallpaper/widget/xml-management/xml-management.cpp
|
||||
+++ b/plugins/appearance/src/pages/wallpaper/widget/xml-management/xml-management.cpp
|
||||
@@ -38,8 +38,8 @@ void XmlManagement::loadXmlFiles()
|
||||
if (!file.exists())
|
||||
{
|
||||
KLOG_DEBUG() << "local xml file no exist";
|
||||
- xmlReader(SYSTEM_WALLPAPER_FILE);
|
||||
- xmlWriter();
|
||||
+ if (xmlReader(SYSTEM_WALLPAPER_FILE))
|
||||
+ xmlWriter();
|
||||
}
|
||||
xmlReader(localFile);
|
||||
}
|
||||
@@ -209,6 +209,11 @@ void XmlManagement::xmlUpdate(QList<QMap<QString, QString>> updateList)
|
||||
{
|
||||
QString localFile = QString("%1/%2").arg(QDir::homePath()).arg(LOCAL_WALLPAPER_FILE);
|
||||
QFile file(localFile);
|
||||
+ if (!file.exists())
|
||||
+ {
|
||||
+ KLOG_DEBUG() << localFile << " doesn't exists!";
|
||||
+ return;
|
||||
+ }
|
||||
if (!file.open(QFile::WriteOnly | QFile::Text))
|
||||
{
|
||||
KLOG_DEBUG() << "open " << localFile << " failed!";
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Name: kiran-control-panel
|
||||
Version: 2.5.5
|
||||
Release: 2
|
||||
Release: 3
|
||||
Summary: Kiran Control Panel
|
||||
Summary(zh_CN): Kiran桌面控制面板
|
||||
|
||||
@ -9,6 +9,8 @@ Source0: %{name}-%{version}.tar.gz
|
||||
|
||||
Patch0001: 0001-fix-network-After-receiving-the-Connection-Update-si.patch
|
||||
Patch0002: 0002-feature-display-When-switching-resolutions-refresh-r.patch
|
||||
Patch0003: 0001-fix-wallpaper-change-system-wallpaper-xml-path-to-ki.patch
|
||||
Patch0004: 0001-fix-wallpaper-don-t-call-xmlWriter-if-system-backgro.patch
|
||||
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: cmake >= 3.2
|
||||
@ -48,6 +50,7 @@ Requires: kiran-qt5-integration >= 2.4
|
||||
Requires: kiran-system-daemon >= 2.4
|
||||
Requires: kiran-session-daemon >= 2.4
|
||||
Requires: kiran-authentication-service >= 2.5
|
||||
Requires: kiran-wallpapers >= 2.3.0-6
|
||||
|
||||
Requires: glib2
|
||||
Requires: upower
|
||||
@ -165,6 +168,10 @@ make %{?_smp_mflags}
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%changelog
|
||||
* Fri Aug 25 2023 yuanxing <yuanxing@kylinsec.com.cn> - 2.5.5-3
|
||||
- KYOS-F: search system wallpaper xml path from kiran-background-properties
|
||||
- KYOS-F: don't call xmlWriter if system background xml not exists to solve segmentation fault
|
||||
|
||||
* Wed Aug 23 2023 luoqing <luoqing@kylinsec.com.cn> - 2.5.5-2
|
||||
- KYOS-F: After receiving the Connection::Update signal from an active connection, the connection is no longer automatically reactivated (#13231)
|
||||
- KYOS-F: When switching resolutions, refresh rate preferentially selects the recommended refresh rate (#13283)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user