Skip to content

Commit

Permalink
Fix an SK Hynix drive
Browse files Browse the repository at this point in the history
  • Loading branch information
edisionnano committed Aug 19, 2024
1 parent da88224 commit 3ee7128
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3ee7128

Please sign in to comment.