From 011bde25983968d4422a1100e182fc2b051cc024 Mon Sep 17 00:00:00 2001 From: Spiros Date: Mon, 3 Jun 2024 19:06:11 +0300 Subject: [PATCH] Add life info for Crucial SATA SSDs --- mainwindow.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index e8a3696..e9648a5 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -281,7 +281,12 @@ void MainWindow::populateWindow(const QJsonObject &localObj, const QString &heal if (!isNvme) { for (const QJsonValue &attr : attributes) { QJsonObject attrObj = attr.toObject(); - if (attrObj["id"] == 241) { + if (attrObj["id"] == 202) { + if (attrObj["name"] == "Percent_Lifetime_Remain") { + int percentageUsed = 100 - attrObj["raw"].toObject()["value"].toInt(); + percentage = QString::number(percentageUsed) + " %"; + } + } else if (attrObj["id"] == 241) { if (attrObj["name"] == "Total_Writes_GB") { totalWrites = QString::number(attrObj["raw"].toObject()["value"].toInt()) + " GB"; } else if (attrObj["name"] == "Host_Writes_32MiB") {