GNOME Bugzilla – Bug 709736
Power plugin D-Bus API cleanups
Last modified: 2013-10-17 15:45:28 UTC
We can probably remove the "Icon" property as well, but we'll need to add a separate signal to tell gnome-shell that the battery changed (or we can move most of those to UPower).
Created attachment 256816 [details] [review] power: Remove unused "Tooltip" property We didn't have a user for it since deb7e7317ea30e012b075a017cd2d987b15c3c0c in gnome-shell (November 2010)
Created attachment 256817 [details] [review] power: Remove unused Percentage property As gnome-shell will use the percentage from the primary device instead.
Review of attachment 256816 [details] [review]: ::: plugins/power/gsd-power-manager.c @@ +277,3 @@ static void engine_emit_changed (GsdPowerManager *manager, + gboolean icon_changed) This parameter is useless now since this function is only ever called with it set to TRUE.
Review of attachment 256817 [details] [review]: Looks good
Seems like we can remove the Icon property too (bug 709925).
Created attachment 257455 [details] [review] power: Remove org.gnome.SettingsDaemon.Power D-Bus interface It was only used by gnome-shell, which now uses UPower directly.
Created attachment 257456 [details] [review] power: Remove use of gpm_device_to_localised_string() It was only ever called with a UPS device.
Created attachment 257457 [details] [review] power: Remove unused helper functions
Created attachment 257458 [details] [review] power: Use new "warning-level" property in UPower
Created attachment 257459 [details] [review] power: Remove unused policy GSettings The percentage and time levels to use for low battery, critically low battery and when to take action is now handled within UPower.
Created attachment 257464 [details] [review] power: Remove org.gnome.SettingsDaemon.Power D-Bus interface It was only used by gnome-shell, which now uses UPower directly.
Created attachment 257514 [details] [review] power: Use up_client_get_critical_action() To get the configured critical action.
Created attachment 257515 [details] [review] power: Remove impossible actions We never do "nothing" or "suspend" when on low battery, as it completely defeats the point. Remove the cases that handle that.
Created attachment 257516 [details] [review] power: Don't do an action on critical battery UPower does that for us.
Created attachment 257517 [details] [review] power: Remove manager_critical{_ups,}_action_do_cb() They didn't do anything different from the existing functions.
Created attachment 257518 [details] [review] power: Naive replacement of our custom composite device Remove the now unneeded engine_update_composite_device() and use the display device instead.
Created attachment 257519 [details] [review] power: Remove unused error checking
Created attachment 257520 [details] [review] power: Use icon-names from UPower Instead of our own.
Created attachment 257521 [details] [review] power: Remove unused gpm_upower_get_device_icon() We're using the icons from UPower now.
Created attachment 257522 [details] [review] power: Simplify checking for the warning-level Instead of capturing the old state, the old warning-level, we now only want changes from the composite device, and the non-battery, non-UPS devices, and just wait for UPower to tell us that the warning level changed.
Created attachment 257523 [details] [review] power: Simplify engine_ups_discharging() It's only ever called for UPS devices.
Created attachment 257524 [details] [review] power: Remove engine_just_laptop_battery() Checking if there's only a laptop battery is as easy as checking if there's no other devices, now that the devices_array doesn't contain batteries or UPSes.
Created attachment 257525 [details] [review] power: Remove "on AC" check from warning-levels UPower already does this for us, to avoid warning levels being set when the batteries didn't notice the AC yet.
Created attachment 257526 [details] [review] power: Stop the alert sound before taking action As it's UPower taking action, make sure that we stop the alert sound before the action is taken. We might wake up to the sound otherwise.
Created attachment 257527 [details] [review] power: Overriding GSD_ACTION_DELAY doesn't do anything There's no need for the test suite to override GSD_ACTION_DELAY, action is now taken on the UPower side.
Created attachment 257528 [details] [review] power: Set on_low_battery when the warning level changes
Created attachment 257529 [details] [review] power: Hide notifications when the warning level changes And stop the warning sound as well. That means, not when the battery state changes, or when resuming, only when the warning level changes.
Created attachment 257530 [details] [review] power: Only listen to lid-is-closed changing We don't need to listen to all the changed signals from UpClient, as we're only interested in the lid state changing.
Created attachment 257531 [details] [review] power: Update for libupower-glib API changes
Attachment 257456 [details] pushed as 077c802 - power: Remove use of gpm_device_to_localised_string() Attachment 257457 [details] pushed as ea7b5f0 - power: Remove unused helper functions Attachment 257458 [details] pushed as 552d021 - power: Use new "warning-level" property in UPower Attachment 257459 [details] pushed as c996793 - power: Remove unused policy GSettings Attachment 257464 [details] pushed as 5bbe63f - power: Remove org.gnome.SettingsDaemon.Power D-Bus interface