From dd5924cc6a4906b6a0b5864c868fe9dd599d726e Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Fri, 23 Oct 2026 04:17:05 +0800 Subject: [PATCH 1/2] fix: add clear to initCmd for idempotency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Root cause: GetInfoPool::initCmd() only appends commands to m_CmdList without clearing it first, making the method non-idempotent; repeated calls double the command count 2. Fix: add m_CmdList.clear() at the start of initCmd() so the method always starts from an empty list 3. Impact: no behavior change for normal single-call path, only fixes the duplicate-command issue when called multiple times Influence: 1. Verify device info collection works correctly after fix 2. Verify command list size is 29 after calling initCmd twice 3. Verify no regression on existing device info collection flow fix: initCmd方法添加clear确保幂等性 1. 根因:GetInfoPool::initCmd() 仅通过 append 追加命令到 m_CmdList,未先清空,方法不具备幂等性,重复调用导致 命令表翻倍 2. 方案:在 initCmd() 开头添加 m_CmdList.clear(),使方法 每次从空列表开始初始化 3. 影响:正常单次调用路径无行为变化,仅修复重复调用时 命令重复问题 Influence: 1. 验证修复后设备信息采集功能正常 2. 验证连续调用两次initCmd后命令列表数量仍为29 3. 验证现有设备信息采集流程无回归 PMS: BUG-DEF-003 --- deepin-devicemanager/src/GenerateDevice/GetInfoPool.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/deepin-devicemanager/src/GenerateDevice/GetInfoPool.cpp b/deepin-devicemanager/src/GenerateDevice/GetInfoPool.cpp index 9121a05c6..876b088e9 100644 --- a/deepin-devicemanager/src/GenerateDevice/GetInfoPool.cpp +++ b/deepin-devicemanager/src/GenerateDevice/GetInfoPool.cpp @@ -85,6 +85,7 @@ void GetInfoPool::setFramework(const QString &arch) void GetInfoPool::initCmd() { qCDebug(appLog) << "GetInfoPool::initCmd start"; + m_CmdList.clear(); m_CmdList.append({ "lshw", "lshw.txt", tr("Loading Audio Device Info...") }); m_CmdList.append({ "printer", "printer.txt", ""}); From 228c44f725f06243bc2da05d279a2684ecdf43b4 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Mon, 26 Oct 2026 18:11:38 +0800 Subject: [PATCH 2/2] chore: update SPDX copyright year to 2022-2026 (CI SPDX check) The license-check CI (SPDX Header Validation) requires files created in earlier years and modified in 2026 to carry a copyright year range ending with the current year. Extend the SPDX-FileCopyrightText header of GetInfoPool.cpp from 2022 to 2022-2026 so the SPDX summary reports 0 failures. --- deepin-devicemanager/src/GenerateDevice/GetInfoPool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepin-devicemanager/src/GenerateDevice/GetInfoPool.cpp b/deepin-devicemanager/src/GenerateDevice/GetInfoPool.cpp index 876b088e9..5f623704e 100644 --- a/deepin-devicemanager/src/GenerateDevice/GetInfoPool.cpp +++ b/deepin-devicemanager/src/GenerateDevice/GetInfoPool.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022-2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later