Fix an SK Hynix drive

This commit is contained in:
Spiros
2024-08-19 13:07:54 +03:00
parent da88224810
commit 3ee7128ee3

View File

@@ -573,11 +573,14 @@ void MainWindow::populateWindow(const QJsonObject &localObj, const QString &heal
int percentageUsed = attrObj["raw"].toObject()["value"].toInt();
percentage = QString::number(percentageUsed) + " %";
} else if (attrObj["name"] == "Percent_Lifetime_Remain") {
int percentageUsed = attrObj["raw"].toObject()["value"].toInt();
int percentageUsed = attrObj["value"].toInt();
percentage = QString::number(percentageUsed) + " %";
} else if (attrObj["name"] == "Media_Wearout_Indicator" || attrObj["name"] == "SSD_Life_Left") {
int percentageUsed = attrObj["value"].toInt();
percentage = QString::number(percentageUsed) + " %";
int percentageUsedWorst = attrObj["worst"].toInt();
if (percentageUsedWorst <= 100) {
percentage = QString::number(percentageUsed) + " %";
}
}
}
if (percentage.isEmpty() && rotationRate == "---- (SSD)") { // Workaround for some drives which have this and another attribute