Set QFile parents
This commit is contained in:
parent
8d9516a494
commit
a9daef7d6b
1 changed files with 3 additions and 3 deletions
|
@ -20,11 +20,11 @@
|
||||||
Battery::Battery(QObject* parent) : QObject(parent)
|
Battery::Battery(QObject* parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
// Number: meaning percentage, e.g. 42
|
// Number: meaning percentage, e.g. 42
|
||||||
chargeFile = new QFile("/run/state/namespaces/Battery/ChargePercentage");
|
chargeFile = new QFile("/run/state/namespaces/Battery/ChargePercentage", this);
|
||||||
// Number: 0 or 1
|
// Number: 0 or 1
|
||||||
chargingFile = new QFile("/run/state/namespaces/Battery/IsCharging");
|
chargingFile = new QFile("/run/state/namespaces/Battery/IsCharging", this);
|
||||||
// String: charging, discharging, (empty), unknown (others?)
|
// String: charging, discharging, (empty), unknown (others?)
|
||||||
stateFile = new QFile("/run/state/namespaces/Battery/ChargingState");
|
stateFile = new QFile("/run/state/namespaces/Battery/ChargingState", this);
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
// What if the files can't be opened?
|
// What if the files can't be opened?
|
||||||
|
|
Loading…
Reference in a new issue