Assign the correct type to some variable and fix shadowing cases

This commit is contained in:
spiros
2024-06-22 19:39:59 +03:00
parent 86c4c7647f
commit 94da0612a5
6 changed files with 73 additions and 59 deletions

View File

@@ -85,8 +85,8 @@ QPair<QStringList, QJsonArray> utils::scanDevices(bool initializing)
QString allDevicesOutput = getSmartctlOutput({"sh", "-c", command}, true, initializing);
int startIndex = 0;
int endIndex = 0;
qsizetype startIndex = 0;
qsizetype endIndex = 0;
static const QRegularExpression regex("\\}\\n\\{");
@@ -153,8 +153,6 @@ void utils::selfTestHandler(const QString &mode, const QString &name, const QStr
QJsonDocument testDoc = QJsonDocument::fromJson(output.toUtf8());
QJsonObject testObj = testDoc.object();
QJsonObject smartctlObj = testObj.value("smartctl").toObject();
QJsonObject deviceObj = testObj.value("device").toObject();
QString name = deviceObj.value("name").toString();
int exitStatus = smartctlObj.value("exit_status").toInt();
QJsonArray outputArray = smartctlObj["output"].toArray();