From 9271e9b3c0d2f28680c00557b73f3e4561cbe7e3 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Fri, 5 Sep 2025 14:00:56 +0800 Subject: [PATCH 1/6] fix: Set timeout for device info loading to prevent infinite waiting - Change waitForDone(-1) to waitForDone(60000) in MainJob::updateAllDevice() - Add 60-second timeout to prevent device manager from hanging during device info loading - Improve application responsiveness and user experience pick from: https://github.com/linuxdeepin/deepin-devicemanager/commit/00f82e675a59a6544456d429fdae6d47a001c095 Log: Set timeout for device info loading to prevent infinite waiting Bug: https://pms.uniontech.com/bug-view-331983.html Change-Id: Iab0310719df4cfa7e13176975ee0db59572d88ce --- deepin-devicemanager-server/deepin-deviceinfo/src/mainjob.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepin-devicemanager-server/deepin-deviceinfo/src/mainjob.cpp b/deepin-devicemanager-server/deepin-deviceinfo/src/mainjob.cpp index a07b9a70..b2b034f0 100644 --- a/deepin-devicemanager-server/deepin-deviceinfo/src/mainjob.cpp +++ b/deepin-devicemanager-server/deepin-deviceinfo/src/mainjob.cpp @@ -176,7 +176,7 @@ void MainJob::updateAllDevice() qCDebug(appLog) << "Updating existing device info"; m_pool->updateDeviceInfo(); } - m_pool->waitForDone(-1); + m_pool->waitForDone(60000); PERF_PRINT_END("POINT-01"); m_firstUpdate = false; } From a26d1aa50d038203c9f806ba64af7b11f45f9c00 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Thu, 11 Sep 2025 13:43:26 +0800 Subject: [PATCH 2/6] feat: Adjust CPU frequency values for specific device type Modified CPU frequency display for kSpecialType6 devices include current frequency and max frequency to correct hardware reporting inaccuracies. Log: Fix CPU frequency display for special device type Task: https://pms.uniontech.com/task-view-381765.html Change-Id: I3a715b263868c6825ee42941b64a7c5de6a53035 --- deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp b/deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp index ee99622e..946221ec 100644 --- a/deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp +++ b/deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp @@ -53,6 +53,11 @@ void DeviceCpu::setCpuInfo(const QMap &mapLscpu, const QMap Date: Mon, 15 Sep 2025 09:30:36 +0800 Subject: [PATCH 3/6] fix: [cppcheck] Improve code formatting for architecture mapping Enhanced readability of the architecture mapping table by reformatting the static QMap initialization with proper indentation and line breaks. also add comments for variables. Log: Refactor architecture mapping code style Change-Id: Iea19f9e13e7b8f59f66d34877e555994832a0221 --- .../deepin-devicecontrol/src/drivercontrol/commonfunction.h | 3 ++- deepin-devicemanager/src/Tool/DBusAnythingInterface.h | 4 ++-- deepin-devicemanager/src/Tool/EDIDParser.h | 4 ++-- deepin-devicemanager/src/Tool/ThreadExecXrandr.h | 2 +- deepin-devicemanager/src/Tool/commontools.h | 3 +-- deepin-devicemanager/src/commonfunction.cpp | 3 ++- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/deepin-devicemanager-server/deepin-devicecontrol/src/drivercontrol/commonfunction.h b/deepin-devicemanager-server/deepin-devicecontrol/src/drivercontrol/commonfunction.h index 3d1ba92d..93fd468f 100644 --- a/deepin-devicemanager-server/deepin-devicecontrol/src/drivercontrol/commonfunction.h +++ b/deepin-devicemanager-server/deepin-devicecontrol/src/drivercontrol/commonfunction.h @@ -11,7 +11,8 @@ #include -static QMap mapArch = { {"aarch64", "arm64"} +static QMap mapArch = { + {"aarch64", "arm64"} , {"x86_64", "amd64"} , {"mips64", "mips64el"} , {"i386", "i386"} diff --git a/deepin-devicemanager/src/Tool/DBusAnythingInterface.h b/deepin-devicemanager/src/Tool/DBusAnythingInterface.h index 544af703..c35df746 100644 --- a/deepin-devicemanager/src/Tool/DBusAnythingInterface.h +++ b/deepin-devicemanager/src/Tool/DBusAnythingInterface.h @@ -64,8 +64,8 @@ class DBusAnythingInterface : public QObject private: static std::atomic s_Instance; - static std::mutex m_mutex; - QDBusInterface *mp_Iface; + static std::mutex m_mutex; + QDBusInterface *mp_Iface; }; #endif // DBUSANYTHINGINTERFACE_H diff --git a/deepin-devicemanager/src/Tool/EDIDParser.h b/deepin-devicemanager/src/Tool/EDIDParser.h index 32aa9820..2287fdbf 100644 --- a/deepin-devicemanager/src/Tool/EDIDParser.h +++ b/deepin-devicemanager/src/Tool/EDIDParser.h @@ -148,7 +148,7 @@ class EDIDParser private: /**@brief:机器的存储模式不同,会导致计算结果不同,所以在解析的时候需要考虑大小端模式*/ QString m_Vendor; // 显示屏的厂商信息 - QString m_Model; // 显示屏的型号信息 + QString m_Model; // 显示屏的型号信息 QString m_ReleaseDate; // 显示屏的生产日期 QString m_ScreenSize; // 屏幕大小 QString m_MonitorName; // 监视器名称 @@ -156,7 +156,7 @@ class EDIDParser int m_Width; // width int m_Height; // heigth QStringList m_ListEdid; // edid数据 - QMap m_MapCh; // + QMap m_MapCh; // 二进制字符串映射到字母A-Z }; diff --git a/deepin-devicemanager/src/Tool/ThreadExecXrandr.h b/deepin-devicemanager/src/Tool/ThreadExecXrandr.h index 563d90a9..5e36699d 100644 --- a/deepin-devicemanager/src/Tool/ThreadExecXrandr.h +++ b/deepin-devicemanager/src/Tool/ThreadExecXrandr.h @@ -76,7 +76,7 @@ class ThreadExecXrandr : public QThread private: bool m_Gpu; // m_MapDriverType; static QMap m_MapStatusIcon; static QMap m_MapStatusType; - - static QMap m_MapErrorString; + static QMap m_MapErrorString; }; #endif // COMMONTOOLS_H diff --git a/deepin-devicemanager/src/commonfunction.cpp b/deepin-devicemanager/src/commonfunction.cpp index 73bbaa15..fc1dfccf 100644 --- a/deepin-devicemanager/src/commonfunction.cpp +++ b/deepin-devicemanager/src/commonfunction.cpp @@ -20,7 +20,8 @@ using namespace DDLog; -static QMap mapArch = { {"aarch64", "arm64"} +static QMap mapArch = { + {"aarch64", "arm64"} , {"x86_64", "amd64"} , {"mips64", "mips64el"} , {"i386", "i386"} From 4ad588eda7ef8eeddc821423eb9da9eb07f37ea4 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Mon, 15 Sep 2025 13:42:02 +0800 Subject: [PATCH 4/6] feat: Adjust CPU frequency for kSpecialType5 device Modified CPU frequency display for kSpecialType5 devices include current frequency and max frequency to correct hardware reporting inaccuracies. Log: Fix CPU frequency display for special device type Task: https://pms.uniontech.com/task-view-381921.html Change-Id: Ia80c7e9edf7618188874e0648cb599920f49eada --- deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp | 3 ++- deepin-devicemanager/src/commonfunction.cpp | 2 +- deepin-devicemanager/src/commonfunction.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp b/deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp index 946221ec..896a1405 100644 --- a/deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp +++ b/deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp @@ -53,7 +53,8 @@ void DeviceCpu::setCpuInfo(const QMap &mapLscpu, const QMap Date: Mon, 15 Sep 2025 14:29:12 +0800 Subject: [PATCH 5/6] feat: Adjust CPU frequency values for specific device type Modified CPU frequency display for kSpecialType7 devices include current frequency and max frequency to correct hardware reporting inaccuracies. Log: Fix CPU frequency display for special device type Task: https://pms.uniontech.com/task-view-381765.html Change-Id: Id37a4b03a83ccb6428a1bd3edf601d905edbd2c8 --- deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp b/deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp index 896a1405..005b5067 100644 --- a/deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp +++ b/deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp @@ -54,7 +54,8 @@ void DeviceCpu::setCpuInfo(const QMap &mapLscpu, const QMap Date: Tue, 16 Sep 2025 13:26:08 +0800 Subject: [PATCH 6/6] fix: Clear driver field when value is usbfs Added condition to reset the driver information when its value is "usbfs" (case-insensitive comparison) to handle invalid driver identifiers. Log: Filter out usbfs driver values Bug: https://pms.uniontech.com/bug-view-333969.html Change-Id: I4f2632c9ccef6f9df668460adda9b9078a65b932 --- deepin-devicemanager/src/DeviceManager/DeviceOthers.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deepin-devicemanager/src/DeviceManager/DeviceOthers.cpp b/deepin-devicemanager/src/DeviceManager/DeviceOthers.cpp index dc5c9328..f1c5cab4 100644 --- a/deepin-devicemanager/src/DeviceManager/DeviceOthers.cpp +++ b/deepin-devicemanager/src/DeviceManager/DeviceOthers.cpp @@ -43,7 +43,8 @@ void DeviceOthers::setInfoFromLshw(const QMap &mapInfo) setAttribute(mapInfo, "maxpower", m_MaximumPower); setAttribute(mapInfo, "speed", m_Speed); setAttribute(mapInfo, "logical name", m_LogicalName); - + if (m_Driver.toLower() == "usbfs") + m_Driver.clear(); if(m_Driver.isEmpty() && !m_Avail.compare("yes", Qt::CaseInsensitive)){ qCDebug(appLog) << "DeviceOthers::setInfoFromLshw, driver is empty and avail is yes"; setForcedDisplay(true); @@ -99,7 +100,8 @@ void DeviceOthers::setInfoFromHwinfo(const QMap &mapInfo) setAttribute(mapInfo, "Module Alias", m_Modalias); setAttribute(mapInfo, "VID_PID", m_VID_PID); m_PhysID = m_VID_PID; - + if (m_Driver.toLower() == "usbfs") + m_Driver.clear(); if (mapInfo["Hardware Class"] != "fingerprint") { qCDebug(appLog) << "DeviceOthers::setInfoFromHwinfo, hardware class is not fingerprint"; m_HardwareClass = "others";