Skip to content

Commit

Permalink
fix: 1.02TB问题修改
Browse files Browse the repository at this point in the history
1.02TB问题修改

Log: 1.02TB问题修改

Bug: https://pms.uniontech.com/bug-view-211013.html
  • Loading branch information
jeffshuai authored and deepin-bot[bot] committed Nov 3, 2023
1 parent 72adfdd commit 7baf7d9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions deepin-devicemanager/src/DeviceManager/DeviceStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

// 项目自身文件
#include "DeviceStorage.h"
#include "commonfunction.h"

// Qt库文件
#include<QDebug>
Expand Down Expand Up @@ -609,9 +610,6 @@ void DeviceStorage::getInfoFromsmartctl(const QMap<QString, QString> &mapInfo)
m_Size = reg.cap(1);
}

// 修正数值
m_Size.replace(QRegExp("\\.0[1-9]"), ".00");

// 通过不断适配,当厂商有在固件中提供时,硬盘型号从smartctl中获取更加合理
// 因为hwinfo获取的是主控的型号,而硬盘厂商由于还不能自己生产主控,只能采购别人的主控
//SATA
Expand All @@ -622,4 +620,9 @@ void DeviceStorage::getInfoFromsmartctl(const QMap<QString, QString> &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_Size.replace(QRegExp("\\.0[1-9]"), ".00");
}

0 comments on commit 7baf7d9

Please sign in to comment.