Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 1.02TB问题修改 #259

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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");
}
Loading