diff --git a/0001-fix-systeminfo-Adjusting-the-reading-method-of-cpu-i.patch b/0001-fix-systeminfo-Adjusting-the-reading-method-of-cpu-i.patch new file mode 100644 index 0000000000000000000000000000000000000000..3efc7c451df27c4b6b085b49f72a0be0127bb7b9 --- /dev/null +++ b/0001-fix-systeminfo-Adjusting-the-reading-method-of-cpu-i.patch @@ -0,0 +1,112 @@ +From 4d39214b78a856c591b76f445927f7d0edf8f5b7 Mon Sep 17 00:00:00 2001 +From: wangtaozhi +Date: Mon, 12 Jun 2023 10:47:23 +0800 +Subject: [PATCH] fix(systeminfo): Adjusting the reading method of cpu + information,Resolve program crash issue when exiting the program +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 调整cup信息读取方式 +- 解决程序退出时连接wm_window_changed_信号的对象已经析构导致程序崩溃问题 + +Fixes #6911 +--- + plugins/keybinding/system-shortcut.h | 2 +- + plugins/systeminfo/systeminfo-hardware.cpp | 33 +++++++++++++++++----- + plugins/systeminfo/systeminfo-hardware.h | 2 ++ + 3 files changed, 29 insertions(+), 8 deletions(-) + +diff --git a/plugins/keybinding/system-shortcut.h b/plugins/keybinding/system-shortcut.h +index 367f33a..b6f3a7d 100644 +--- a/plugins/keybinding/system-shortcut.h ++++ b/plugins/keybinding/system-shortcut.h +@@ -39,7 +39,7 @@ struct SystemShortCut + sigc::connection connection; + }; + +-class SystemShortCuts ++class SystemShortCuts: public sigc::trackable + { + public: + SystemShortCuts(); +diff --git a/plugins/systeminfo/systeminfo-hardware.cpp b/plugins/systeminfo/systeminfo-hardware.cpp +index 66b7b49..7001b86 100644 +--- a/plugins/systeminfo/systeminfo-hardware.cpp ++++ b/plugins/systeminfo/systeminfo-hardware.cpp +@@ -26,6 +26,8 @@ namespace Kiran + #define CPUINFO_FILE "/proc/cpuinfo" + #define CPUINFO_KEY_DELIMITER ':' + #define CPUINFO_KEY_MODEL "model name" ++//龙芯cpuinfo中为大写 ++#define CPUINFO_KEY_MODEL_LS "Model Name" + #define CPUINFO_KEY_PROCESSOR "processor" + + #define MEMINFO_FILE "/proc/meminfo" +@@ -82,18 +84,31 @@ HardwareInfo SystemInfoHardware::get_hardware_info() + return hardware_info; + } + +-CPUInfo SystemInfoHardware::get_cpu_info() ++CPUInfo SystemInfoHardware::merge_cpu_infos(const std::vector &cpu_infos) + { +- auto cpu_info = this->get_cpu_info_by_cmd(); +- +- if (cpu_info.cores_number == 0) ++ CPUInfo cpu_info; ++ for(auto& iter : cpu_infos) + { +- cpu_info = this->read_cpu_info_by_conf(); ++ if(cpu_info.model.empty()) ++ { ++ cpu_info.model = iter.model; ++ } ++ if(cpu_info.cores_number == 0) ++ { ++ cpu_info.cores_number = iter.cores_number; ++ } + } +- + return cpu_info; + } + ++CPUInfo SystemInfoHardware::get_cpu_info() ++{ ++ std::vector cpu_infos; ++ cpu_infos.push_back(this->get_cpu_info_by_cmd()); ++ cpu_infos.push_back(this->read_cpu_info_by_conf()); ++ return this->merge_cpu_infos(cpu_infos); ++} ++ + CPUInfo SystemInfoHardware::get_cpu_info_by_cmd() + { + // 低版本不支持-J选项 +@@ -140,7 +155,11 @@ CPUInfo SystemInfoHardware::read_cpu_info_by_conf() + { + CPUInfo cpu_info; + auto cpu_maps = this->parse_info_file(CPUINFO_FILE, CPUINFO_KEY_DELIMITER); +- ++ //适配龙芯架构 ++ if(cpu_info.model.empty()) ++ { ++ cpu_info.model = cpu_maps[CPUINFO_KEY_MODEL_LS]; ++ } + cpu_info.model = cpu_maps[CPUINFO_KEY_MODEL]; + if (cpu_maps.find(CPUINFO_KEY_PROCESSOR) != cpu_maps.end()) + { +diff --git a/plugins/systeminfo/systeminfo-hardware.h b/plugins/systeminfo/systeminfo-hardware.h +index 7aa25c4..2e95382 100644 +--- a/plugins/systeminfo/systeminfo-hardware.h ++++ b/plugins/systeminfo/systeminfo-hardware.h +@@ -112,6 +112,8 @@ private: + CPUInfo get_cpu_info_by_cmd(); + // 如果命令获取失败,则直接读取配置文件 + CPUInfo read_cpu_info_by_conf(); ++ // 合并读取信息 ++ CPUInfo merge_cpu_infos(const std::vector &cpu_infos); + + MemInfo get_mem_info(); + void set_env(); +-- +2.40.1.windows.1 + diff --git a/kiran-cc-daemon.spec b/kiran-cc-daemon.spec index 7364443d9f38e436e3b6334f808fb7e06f16df1c..056c7124b66715d8f47431d8545106b15ef6ca4a 100644 --- a/kiran-cc-daemon.spec +++ b/kiran-cc-daemon.spec @@ -1,6 +1,6 @@ Name: kiran-cc-daemon Version: 2.5.1 -Release: 11 +Release: 12 Summary: DBus daemon for Kiran Desktop License: MulanPSL-2.0 @@ -14,6 +14,7 @@ Patch0005: 0001-feature-power-Delete-LockScreenWhenHibernate-and-Loc.patch Patch0006: 0001-fix-identification-issues-in-control-centers.patch Patch0007: 0001-fix-keybinding-Add-support-desktop-key-for-GC.patch Patch0008: 0001-fix-display-Add-adaptive-screen-change-flag.patch +Patch0009: 0001-fix-systeminfo-Adjusting-the-reading-method-of-cpu-i.patch BuildRequires: cmake >= 3.2 @@ -184,6 +185,10 @@ glib-compile-schemas /usr/share/glib-2.0/schemas &> /dev/nulls || : %{_libdir}/pkgconfig/kiran-cc-daemon.pc %changelog +* Fri Jun 9 2023 wangtaozhi - 2.5.1-12 +- KYOS-F: Adjusting the reading method of cpu information +- KYOS-F: Resolve program crash issue when exiting the program + * Tue May 30 2023 huangjiawen - 2.5.1-11 - KYOS-F: Add adaptive screen change flag