From 8133e4f61bc162ac65e748bd293caf63228f07ea Mon Sep 17 00:00:00 2001 From: shuaijie Date: Fri, 3 Nov 2023 13:22:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=201.02TB=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=201.02TB=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9=20Log:?= =?UTF-8?q?=201.02TB=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9=20Bug:=20https://?= =?UTF-8?q?pms.uniontech.com/bug-view-211013.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/DeviceManager/DeviceStorage.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/deepin-devicemanager/src/DeviceManager/DeviceStorage.cpp b/deepin-devicemanager/src/DeviceManager/DeviceStorage.cpp index 726d27c2..124fc5ec 100644 --- a/deepin-devicemanager/src/DeviceManager/DeviceStorage.cpp +++ b/deepin-devicemanager/src/DeviceManager/DeviceStorage.cpp @@ -4,6 +4,7 @@ // 项目自身文件 #include "DeviceStorage.h" +#include "commonfunction.h" // Qt库文件 #include @@ -609,9 +610,6 @@ void DeviceStorage::getInfoFromsmartctl(const QMap &mapInfo) m_Size = reg.cap(1); } - // 修正数值 - m_Size.replace(QRegExp("\\.0[1-9]"), ".00"); - // 通过不断适配,当厂商有在固件中提供时,硬盘型号从smartctl中获取更加合理 // 因为hwinfo获取的是主控的型号,而硬盘厂商由于还不能自己生产主控,只能采购别人的主控 //SATA @@ -622,4 +620,10 @@ void DeviceStorage::getInfoFromsmartctl(const QMap &mapInfo) m_Name = mapInfo["Model Number"]; setAttribute(mapInfo, "Serial Number", m_SerialNumber, true); + + // 修正数值 + if((Common::boardVendorType() != "KLVV" && Common::boardVendorType() != "KLVU" \ + && Common::boardVendorType() != "PGUW" && Common::boardVendorType() != "PGUV") \ + && (m_Vendor.contains("Yangtze", Qt::CaseInsensitive) || m_Name.contains("YMTC", Qt::CaseInsensitive))) + m_Size.replace(QRegExp("\\.0[1-9]"), ".00"); }