From 86c4c7647f47e599b3d8c071a777b299611ecc18 Mon Sep 17 00:00:00 2001 From: spiros Date: Sat, 22 Jun 2024 18:04:27 +0300 Subject: [PATCH] Remove some useless casts --- src/mainwindow.cpp | 2 +- src/statusdot.cpp | 2 +- src/utils.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f673944..4b7544e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -643,7 +643,7 @@ void MainWindow::populateWindow(const QJsonObject &localObj, const QString &heal int i = 0; for (const QString& key : keys) { - QString minutes = QString::number(static_cast(pollingMinutes[key].toInt())); + QString minutes = QString::number(pollingMinutes[key].toInt()); QString keyTranslated; if (key == "short") { keyTranslated = tr("Short"); diff --git a/src/statusdot.cpp b/src/statusdot.cpp index e98760f..8cf5971 100644 --- a/src/statusdot.cpp +++ b/src/statusdot.cpp @@ -9,7 +9,7 @@ void StatusDot::paint(QPainter *painter, const QStyleOptionViewItem &option, con painter->save(); painter->setRenderHint(QPainter::Antialiasing, true); QRect dotRect(opt.rect.center().x() - dotSize / 2, opt.rect.center().y() - dotSize / 2, dotSize, dotSize); - QColor color = QColor(index.data(Qt::BackgroundRole).value()); + QColor color = index.data(Qt::BackgroundRole).value(); painter->setBrush(color); painter->setPen(Qt::NoPen); painter->drawEllipse(dotRect); diff --git a/src/utils.cpp b/src/utils.cpp index 1a23089..7f52c06 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -74,7 +74,7 @@ QPair utils::scanDevices(bool initializing) for (const QJsonValue &value : std::as_const(devices)) { QJsonObject device = value.toObject(); QString deviceName = device["name"].toString(); - commandList.append(QString(smartctlPath + " --all --json=o %1").arg(deviceName)); + commandList.append((smartctlPath + " --all --json=o %1").arg(deviceName)); } QString command = commandList.join(" ; ");