From 6b7e588344efa8d039e4783d63649848c8b398cf Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Tue, 20 May 2025 14:26:53 +0800 Subject: [PATCH 1/4] fix: filter the invalid power device (#461) filter the invalid power device pick from: https://github.com/linuxdeepin/deepin-devicemanager/commit/da94bed99eace463fe55485f9b154406eafd8e13 Log: filter the invalid power device Task: https://pms.uniontech.com/task-view-376787.html --- deepin-devicemanager/src/DeviceManager/DevicePower.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deepin-devicemanager/src/DeviceManager/DevicePower.cpp b/deepin-devicemanager/src/DeviceManager/DevicePower.cpp index 0fea39c8..e06c0a86 100644 --- a/deepin-devicemanager/src/DeviceManager/DevicePower.cpp +++ b/deepin-devicemanager/src/DeviceManager/DevicePower.cpp @@ -71,7 +71,9 @@ bool DevicePower::setInfoFromUpower(const QMap &mapInfo) { qCDebug(appLog) << "DevicePower::setInfoFromUpower"; // 设置upower中获取的信息 - if (mapInfo["Device"].contains("line_power", Qt::CaseInsensitive)) { + if (mapInfo["Device"].contains("line_power", Qt::CaseInsensitive) || + mapInfo["state"].contains("empty", Qt::CaseInsensitive) || + mapInfo["state"].contains("unknown", Qt::CaseInsensitive)) { qCDebug(appLog) << "DevicePower::setInfoFromUpower, device contains line_power"; return false; } From d5f52af8ace8a2bafc3392fae9eae48395bc5ec2 Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Wed, 21 May 2025 10:30:42 +0800 Subject: [PATCH 2/4] fix: the invalded device show incorrect (#462) fix the invalded device show incorrect Log: fix the invalded device show incorrect Bug: https://pms.uniontech.com/bug-view-256787.html Change-Id: I57c51ef8462b11a369a9f0276f039552a9ea2825 --- deepin-devicemanager/src/DeviceManager/DeviceManager.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/deepin-devicemanager/src/DeviceManager/DeviceManager.cpp b/deepin-devicemanager/src/DeviceManager/DeviceManager.cpp index da62ec31..4df09176 100644 --- a/deepin-devicemanager/src/DeviceManager/DeviceManager.cpp +++ b/deepin-devicemanager/src/DeviceManager/DeviceManager.cpp @@ -696,11 +696,6 @@ void DeviceManager::tomlDeviceSet(DeviceType deviceType) DeviceBaseInfo *newDevice = createDevice(deviceType); tomlDeviceMapSet(deviceType, newDevice, tomlMapLst[j]); tomlDeviceAdd(deviceType, newDevice); //加 - } else if ((deviceType != DT_Bios) && (deviceType != DT_Computer) && !fixSameOne) { - fixSameOne = true; //标记为该项信息有用过 ,则不再增加了 - DeviceBaseInfo *device = createDevice(deviceType); - tomlDeviceMapSet(deviceType, device, tomlMapLst[j]); - tomlDeviceAdd(deviceType, device); //不存在 就加 } } //end of for (int j = 0;... } From 185edc8858e482edb423365fcc2cc7aa2e329be1 Mon Sep 17 00:00:00 2001 From: gongheng Date: Tue, 27 May 2025 10:26:52 +0800 Subject: [PATCH 3/4] Fix: the monitor device incorrect order (#463) -- fix the monitor device incorrect order Log: fix issue Bug: https://pms.uniontech.com/bug-view-317457.html --- deepin-devicemanager/src/Tool/ThreadExecXrandr.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/deepin-devicemanager/src/Tool/ThreadExecXrandr.cpp b/deepin-devicemanager/src/Tool/ThreadExecXrandr.cpp index 5e314f44..1b336e14 100644 --- a/deepin-devicemanager/src/Tool/ThreadExecXrandr.cpp +++ b/deepin-devicemanager/src/Tool/ThreadExecXrandr.cpp @@ -151,6 +151,10 @@ void ThreadExecXrandr::loadXrandrVerboseInfo(QList> &lstM // 新的显示屏 QMap newMap; newMap.insert("mainInfo", (*it).trimmed()); + auto mainInfoList = (*it).trimmed().split(" "); + if (mainInfoList.size() > 0) { + newMap.insert("port", mainInfoList.at(0)); + } lstMap.append(newMap); continue; } @@ -276,9 +280,12 @@ void ThreadExecXrandr::getMonitorInfoFromXrandrVerbose() QList> lstMap; loadXrandrVerboseInfo(lstMap, "xrandr --verbose"); - if (Common::specialComType == Common::SpecialComputerType::NormalCom) { - std::reverse(lstMap.begin(), lstMap.end()); - } + std::sort(lstMap.begin(), lstMap.end(), [](const QMap &monintor1, const QMap &monintor2) { + if (monintor1.contains("port") && monintor2.contains("port")) + return monintor1.value("port") < monintor2.value("port"); + else + return false; + }); QList >::const_iterator it = lstMap.begin(); for (; it != lstMap.end(); ++it) { if ((*it).size() < 1) From b5ac1f19a668c20903e3e0d2b9ec969db9cd1b8a Mon Sep 17 00:00:00 2001 From: zhanghongyuan Date: Thu, 29 May 2025 10:42:36 +0800 Subject: [PATCH 4/4] fix: modify the temperature of battery. fix the temperature of battery. pick from: https://github.com/linuxdeepin/deepin-devicemanager/commit/07bb6c90ccebb7c12471d935587964cc73aaffe7 Log: fix the temperature of battery. Bug: https://pms.uniontech.com/task-view-377193.html --- deepin-devicemanager/src/DeviceManager/DevicePower.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepin-devicemanager/src/DeviceManager/DevicePower.cpp b/deepin-devicemanager/src/DeviceManager/DevicePower.cpp index e06c0a86..c2c1e398 100644 --- a/deepin-devicemanager/src/DeviceManager/DevicePower.cpp +++ b/deepin-devicemanager/src/DeviceManager/DevicePower.cpp @@ -209,7 +209,7 @@ void DevicePower::loadBaseDeviceInfo() addBaseDeviceInfo("SBDS Serial Number", m_SBDSSerialNumber); addBaseDeviceInfo("SBDS Manufacture Date", m_SBDSManufactureDate); addBaseDeviceInfo("SBDS Chemistry", m_SBDSChemistry); - addBaseDeviceInfo("Temperature", m_Temp); + addBaseDeviceInfo(("Temperature"), m_Temp.replace("degrees C", "℃", Qt::CaseInsensitive)); } void DevicePower::loadOtherDeviceInfo()