Fix application crash on startup
This commit is contained in:
parent
c5dbb6d6a3
commit
073defa4fc
1 changed files with 1 additions and 3 deletions
|
@ -39,10 +39,8 @@ Battery::Battery(Settings* newSettings, QObject* parent) : QObject(parent)
|
|||
qInfo() << "Charger control feature disabled";
|
||||
}
|
||||
else {
|
||||
chargingEnabledFile = new QFile(this);
|
||||
|
||||
// e.g. for Sony Xperia XA2
|
||||
chargingEnabledFile->setFileName("/sys/class/power_supply/battery/input_suspend");
|
||||
chargingEnabledFile = new QFile("/sys/class/power_supply/battery/input_suspend", this);
|
||||
if(chargingEnabledFile->exists()) {
|
||||
enableChargingValue = 0;
|
||||
disableChargingValue = 1;
|
||||
|
|
Loading…
Reference in a new issue