From c6e8145afc3754f1f4e56e8f3db079a2c61d3b11 Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Mon, 26 Apr 2021 17:13:49 +0300 Subject: [PATCH] Remove unused code --- application/src/battery.cpp | 17 ----------------- application/src/battery.h | 3 +-- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/application/src/battery.cpp b/application/src/battery.cpp index 8433612..2b6f757 100644 --- a/application/src/battery.cpp +++ b/application/src/battery.cpp @@ -141,23 +141,6 @@ QString Battery::getState() { return state; } bool Battery::getChargingEnabled() { return chargingEnabled; } -void Battery::setChargingEnabled(const bool isEnabled) { - if(chargingEnabledFile && chargingEnabledFile->open(QIODevice::WriteOnly)) { - if(chargingEnabledFile->write(QString("%1").arg(isEnabled ? enableChargingValue : disableChargingValue).toLatin1())) { - chargingEnabled = isEnabled; - emit chargingEnabledChanged(chargingEnabled); - - if(isEnabled) { - logD("Charging resumed"); - } - else { - logD("Charging paused"); - } - } - chargingEnabledFile->close(); - } -} - bool Battery::getChargerConnected() { return chargerConnected; } diff --git a/application/src/battery.h b/application/src/battery.h index 508b0e3..b059d86 100644 --- a/application/src/battery.h +++ b/application/src/battery.h @@ -34,7 +34,7 @@ class Battery : public QObject Q_PROPERTY(int current READ getCurrent NOTIFY currentChanged) Q_PROPERTY(bool chargerConnected READ getChargerConnected NOTIFY chargerConnectedChanged) Q_PROPERTY(QString state READ getState NOTIFY stateChanged) - Q_PROPERTY(bool chargingEnabled READ getChargingEnabled WRITE setChargingEnabled NOTIFY chargingEnabledChanged) + Q_PROPERTY(bool chargingEnabled READ getChargingEnabled NOTIFY chargingEnabledChanged) public: Battery(Settings* newSettings, Logger* newLogger, QObject* parent = nullptr); @@ -47,7 +47,6 @@ public: QString getState(); bool getChargingEnabled(); - void setChargingEnabled(const bool isEnabled); public slots: void updateData();