components/batterycontrol: React to D-Bus service (un)register events (6.2 cherry-pick)
Cherry-pick MR for !4729 (merged).
components/batterycontrol: React to D-Bus service (un)register events
Previously, the "Power and Battery" applet only checked for the presence of PowerDevil's D-Bus services once when it starts up. This appears to (mostly?) work for applets embedded in a panel, but does not work for applets on the desktop itself. Likely there's a timing issue and applets on the desktop start sooner than PowerDevil will advertise its services.
A better way to work is for the applet to monitor the bus for when the relevant services appear or disappear. When observing a service registered or unregistered event, the applet gets set up accordingly.
This fixes the race condition for one out of three applet parts (battery state) but does not fix power profiles & inhibitions; these were fixed separately in the powerdevil repository via commit 8e698dbc.
BUG: 488915 BUG: 489003 CCBUG: 492859 CCBUG: 492945
components/batterycontrol: Use m_
prefix for all member variables
The odd one out, namesMonitor
, should use the common prefix
like all other member variables in BatteryControlModel
do.