From c0e6e7d4090669944345c0b9a432e7548c1c6a11 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Fri, 23 Oct 2026 08:23:23 +0800 Subject: [PATCH] fix: clear stale boardVendorKey in else branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Root cause: checkBoardVendorFlag() else branch does not clear static boardVendorKey before dmidecode matching, leaving stale cache from previous calls across device type changes 2. Fix: add boardVendorKey = "" at else branch entry to reset cache, ensuring clean state before model detection begins 3. Impact: M900/W525 fallback logic now triggers correctly when no known model matches; specialComType != -1 branch unaffected Log: Fixed board vendor detection on unknown device models Influence: 1. Test board vendor detection on known models (KLVV/KLVU/PGUV/PGUW/PGUX) 2. Test M900/W525 fallback when dmidecode returns unknown model 3. Verify no regression on specialComType-based device detection fix: 修复 else 分支中 boardVendorKey 缓存残留问题 1. 根因:checkBoardVendorFlag() else 分支在 dmidecode 匹配前未清空 静态变量 boardVendorKey,导致跨调用缓存残留 2. 方案:在 else 分支入口处添加 boardVendorKey = "" 重置缓存, 确保机型检测前状态干净 3. 影响:未知机型时 M900/W525 兜底逻辑恢复正常触发;不影响 specialComType != -1 分支 Log: 修复未知机型设备的主板厂商检测问题 Influence: 1. 测试已知机型(KLVV/KLVU/PGUV/PGUW/PGUX)的主板厂商检测 2. 测试未知机型时 M900/W525 兜底逻辑是否正常触发 3. 验证 specialComType 分支的设备检测无回归 PMS: BUG-V-6376 --- deepin-devicemanager/src/commonfunction.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/deepin-devicemanager/src/commonfunction.cpp b/deepin-devicemanager/src/commonfunction.cpp index 9f8005469..7145c4661 100644 --- a/deepin-devicemanager/src/commonfunction.cpp +++ b/deepin-devicemanager/src/commonfunction.cpp @@ -181,6 +181,7 @@ QString Common::checkBoardVendorFlag() break; } }else{ + boardVendorKey = ""; QProcess process; process.start("dmidecode", QStringList() << "-s" << "system-product-name"); process.waitForFinished(-1);