mirror of
https://github.com/edisionnano/QDiskInfo.git
synced 2026-03-07 11:59:57 +03:00
Don't show status if smart_status is null
This commit is contained in:
@@ -200,6 +200,7 @@ void MainWindow::updateUI()
|
||||
|
||||
QJsonArray attributes = localObj["ata_smart_attributes"].toObject()["table"].toArray();
|
||||
QString temperature = "-- °C";
|
||||
QJsonValue smartStatusValue = localObj.value("smart_status");
|
||||
bool healthPassed = localObj["smart_status"].toObject()["passed"].toBool();
|
||||
bool caution = false;
|
||||
bool bad = false;
|
||||
@@ -287,7 +288,7 @@ void MainWindow::updateUI()
|
||||
} else if (healthPassed && caution && !bad) {
|
||||
health = tr("Caution");
|
||||
healthColor = cautionColor;
|
||||
} else if ((bad || !healthPassed) && !modelName.isEmpty()){
|
||||
} else if ((bad || !healthPassed) && !modelName.isEmpty() && !smartStatusValue.isNull()){
|
||||
health = tr("Bad");
|
||||
healthColor = badColor;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user