forked from quickshell/quickshell
service/upower: adopt bindable properties
This commit is contained in:
parent
d4deb11216
commit
ff55ac874b
4 changed files with 162 additions and 107 deletions
|
@ -53,13 +53,6 @@ UPower::UPower() {
|
|||
}
|
||||
|
||||
void UPower::init() {
|
||||
QObject::connect(
|
||||
&this->pOnBattery,
|
||||
&dbus::AbstractDBusProperty::changed,
|
||||
this,
|
||||
&UPower::onBatteryChanged
|
||||
);
|
||||
|
||||
this->serviceProperties.setInterface(this->service);
|
||||
this->serviceProperties.updateAllViaGetAll();
|
||||
|
||||
|
@ -143,8 +136,6 @@ UPowerDevice* UPower::displayDevice() { return this->mDisplayDevice; }
|
|||
|
||||
ObjectModel<UPowerDevice>* UPower::devices() { return &this->readyDevices; }
|
||||
|
||||
bool UPower::onBattery() const { return this->pOnBattery.get(); }
|
||||
|
||||
UPower* UPower::instance() {
|
||||
static UPower* instance = new UPower(); // NOLINT
|
||||
return instance;
|
||||
|
@ -173,6 +164,4 @@ ObjectModel<UPowerDevice>* UPowerQml::devices() { // NOLINT
|
|||
return UPower::instance()->devices();
|
||||
}
|
||||
|
||||
bool UPowerQml::onBattery() { return UPower::instance()->onBattery(); }
|
||||
|
||||
} // namespace qs::service::upower
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue