Skip to content

Commit

Permalink
fix:rounded ufs disk capacity
Browse files Browse the repository at this point in the history
 rounded ufs disk capacity

Log:  rounded ufs disk capacity

Bug: https://pms.uniontech.com/bug-view-276121.html
  • Loading branch information
jeffshuai committed Oct 12, 2024
1 parent dd0d7ca commit fd236b3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions deepin-devicemanager/src/DeviceManager/DeviceStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,17 @@ void DeviceStorage::unitConvertByDecimal()
{
if(m_SizeBytes > 0)
m_Size = decimalkilos(m_SizeBytes);

quint64 gbyte = 1000000000;
if (m_Interface.contains("UFS", Qt::CaseInsensitive)) {
if(m_SizeBytes > 255*gbyte && m_SizeBytes < 257*gbyte) {
m_Size = "256 GB";
} else if(m_SizeBytes > 511*gbyte && m_SizeBytes < 513*gbyte) {
m_Size = "512 GB";
} else if(m_SizeBytes > 999*gbyte && m_SizeBytes < 1001*gbyte) {
m_Size = "1 TB";
}
}
}

bool DeviceStorage::setHwinfoInfo(const QMap<QString, QString> &mapInfo)
Expand Down

0 comments on commit fd236b3

Please sign in to comment.