Fix adata

This commit is contained in:
Spiros
2024-06-04 03:34:15 +03:00
parent b5fafa1414
commit ad3cd1355a

View File

@@ -339,9 +339,16 @@ void MainWindow::populateWindow(const QJsonObject &localObj, const QString &heal
} else if (attrObj["name"] == "Media_Wearout_Indicator") {
int percentageUsed = attrObj["value"].toInt();
percentage = QString::number(percentageUsed) + " %";
} else if (attrObj["name"] == "Wear_Leveling_Count") {
int percentageUsed = attrObj["value"].toInt();
percentage = QString::number(percentageUsed) + " %";
}
}
if (percentage.isEmpty() && rotationRate == "---- (SSD)") { // Workaround for some drives which have this and another attribute
for (const QJsonValue &attr : attributes) {
QJsonObject attrObj = attr.toObject();
if (attrObj["name"] == "Wear_Leveling_Count") {
int percentageUsed = attrObj["value"].toInt();
percentage = QString::number(percentageUsed) + " %";
break;
}
}
}
} else {