From f0e4469c95a21f800c0d5fec8e2682f63fdc360b Mon Sep 17 00:00:00 2001 From: Spiros Date: Mon, 3 Jun 2024 19:15:29 +0300 Subject: [PATCH] Some WD drives provide hex --- mainwindow.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index e9648a5..648f121 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -520,7 +520,12 @@ void MainWindow::addSmartAttributesTable(const QJsonArray &attributes) if (spaceIndex != -1) { raw = raw.left(spaceIndex); } - raw = QString("%1").arg(raw.toUInt(nullptr), 12, 16, QChar('0')).toUpper(); + + if (raw.startsWith("0x") && raw.length() == 14) { + raw = raw.mid(2); + } else { + raw = QString("%1").arg(raw.toUInt(nullptr), 12, 16, QChar('0')).toUpper(); + } QColor statusColor; if (thresh && (value < thresh)) {