From 152d9681aa942166a0d9927297cefff6c6011432 Mon Sep 17 00:00:00 2001 From: yuanxing Date: Fri, 25 Aug 2023 13:55:13 +0800 Subject: [PATCH] fix(wallpaper):change the system wallpaper xml search path to kiran,and solve the segmentation fault when system xml not exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改系统壁纸xml文件搜索路径为kiran,并解决该文件不存在时带来的段错误 --- ...ange-system-wallpaper-xml-path-to-ki.patch | 29 ++++++++++++ ...n-t-call-xmlWriter-if-system-backgro.patch | 44 +++++++++++++++++++ kiran-control-panel.spec | 9 +++- 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 0001-fix-wallpaper-change-system-wallpaper-xml-path-to-ki.patch create mode 100644 0001-fix-wallpaper-don-t-call-xmlWriter-if-system-backgro.patch diff --git a/0001-fix-wallpaper-change-system-wallpaper-xml-path-to-ki.patch b/0001-fix-wallpaper-change-system-wallpaper-xml-path-to-ki.patch new file mode 100644 index 0000000..f25ed9d --- /dev/null +++ b/0001-fix-wallpaper-change-system-wallpaper-xml-path-to-ki.patch @@ -0,0 +1,29 @@ +From bb700629b3b1246b8c23be4f0739a46850685eb5 Mon Sep 17 00:00:00 2001 +From: yuanxing +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 + diff --git a/0001-fix-wallpaper-don-t-call-xmlWriter-if-system-backgro.patch b/0001-fix-wallpaper-don-t-call-xmlWriter-if-system-backgro.patch new file mode 100644 index 0000000..00cbda8 --- /dev/null +++ b/0001-fix-wallpaper-don-t-call-xmlWriter-if-system-backgro.patch @@ -0,0 +1,44 @@ +From 2dc6afb3447969964b51c3d02986796f0d7bd77d Mon Sep 17 00:00:00 2001 +From: yuanxing +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> 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 + diff --git a/kiran-control-panel.spec b/kiran-control-panel.spec index 1256445..34536ad 100644 --- a/kiran-control-panel.spec +++ b/kiran-control-panel.spec @@ -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 @@ -164,6 +167,10 @@ make %{?_smp_mflags} rm -rf %{buildroot} %changelog +* Fri Aug 25 2023 yuanxing - 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 - 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) -- Gitee