diff --git a/application/src/battery.cpp b/application/src/battery.cpp index c8283eb..c307244 100644 --- a/application/src/battery.cpp +++ b/application/src/battery.cpp @@ -23,8 +23,6 @@ Battery::Battery(Settings* newSettings, Logger* newLogger, QObject* parent) : QO logger = newLogger; const QString notFound = "not found"; - QStringList filenames; - // Battery charge percentage, number, e.g. 42 const QStringList batteryFiles = { "/sys/class/power_supply/battery/capacity", @@ -119,7 +117,7 @@ Battery::Battery(Settings* newSettings, Logger* newLogger, QObject* parent) : QO "/sys/class/power_supply/battery/health", "/sys/class/power_supply/dollar_cove_battery/health" }; - foreach(const QString& file, filenames) { + foreach(const QString& file, healthFiles) { if(!healthFile && QFile::exists(file)) { healthFile = new QFile(file, this); break; diff --git a/service/src/battery.cpp b/service/src/battery.cpp index ddbd7a8..0caf35c 100644 --- a/service/src/battery.cpp +++ b/service/src/battery.cpp @@ -34,8 +34,6 @@ Battery::Battery(Logger* newLogger, bool loglevelSet, QCoreApplication *app, QOb chargeNotification = new MyNotification(this); healthNotification = new MyNotification(this); - QStringList filenames; - // Battery charge percentage, number, e.g. 42 const QStringList capacityFiles = { "/sys/class/power_supply/battery/capacity", @@ -171,7 +169,7 @@ Battery::Battery(Logger* newLogger, bool loglevelSet, QCoreApplication *app, QOb "/sys/class/power_supply/battery/health", "/sys/class/power_supply/dollar_cove_battery/health" }; - foreach(const QString& file, filenames) { + foreach(const QString& file, healthFiles) { if(!healthFile && QFile::exists(file)) { healthFile = new QFile(file, this); break;