After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 709736 - Power plugin D-Bus API cleanups
Power plugin D-Bus API cleanups
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: power
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on: 710273
Blocks:
 
 
Reported: 2013-10-09 14:54 UTC by Bastien Nocera
Modified: 2013-10-17 15:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
power: Remove unused "Tooltip" property (16.38 KB, patch)
2013-10-09 14:54 UTC, Bastien Nocera
needs-work Details | Review
power: Remove unused Percentage property (3.31 KB, patch)
2013-10-09 14:54 UTC, Bastien Nocera
accepted-commit_after_freeze Details | Review
power: Remove org.gnome.SettingsDaemon.Power D-Bus interface (20.16 KB, patch)
2013-10-16 20:50 UTC, Bastien Nocera
none Details | Review
power: Remove use of gpm_device_to_localised_string() (1.10 KB, patch)
2013-10-16 20:50 UTC, Bastien Nocera
committed Details | Review
power: Remove unused helper functions (22.20 KB, patch)
2013-10-16 20:50 UTC, Bastien Nocera
committed Details | Review
power: Use new "warning-level" property in UPower (7.79 KB, patch)
2013-10-16 20:50 UTC, Bastien Nocera
committed Details | Review
power: Remove unused policy GSettings (6.01 KB, patch)
2013-10-16 20:51 UTC, Bastien Nocera
committed Details | Review
power: Remove org.gnome.SettingsDaemon.Power D-Bus interface (21.07 KB, patch)
2013-10-16 23:20 UTC, Bastien Nocera
committed Details | Review
power: Use up_client_get_critical_action() (4.49 KB, patch)
2013-10-17 12:52 UTC, Bastien Nocera
committed Details | Review
power: Remove impossible actions (4.16 KB, patch)
2013-10-17 12:52 UTC, Bastien Nocera
committed Details | Review
power: Don't do an action on critical battery (1008 bytes, patch)
2013-10-17 12:52 UTC, Bastien Nocera
committed Details | Review
power: Remove manager_critical{_ups,}_action_do_cb() (2.04 KB, patch)
2013-10-17 12:52 UTC, Bastien Nocera
committed Details | Review
power: Naive replacement of our custom composite device (7.04 KB, patch)
2013-10-17 12:52 UTC, Bastien Nocera
committed Details | Review
power: Remove unused error checking (940 bytes, patch)
2013-10-17 12:52 UTC, Bastien Nocera
committed Details | Review
power: Use icon-names from UPower (8.97 KB, patch)
2013-10-17 12:52 UTC, Bastien Nocera
committed Details | Review
power: Remove unused gpm_upower_get_device_icon() (7.60 KB, patch)
2013-10-17 12:52 UTC, Bastien Nocera
committed Details | Review
power: Simplify checking for the warning-level (9.36 KB, patch)
2013-10-17 12:52 UTC, Bastien Nocera
committed Details | Review
power: Simplify engine_ups_discharging() (1.24 KB, patch)
2013-10-17 12:53 UTC, Bastien Nocera
committed Details | Review
power: Remove engine_just_laptop_battery() (3.66 KB, patch)
2013-10-17 12:53 UTC, Bastien Nocera
committed Details | Review
power: Remove "on AC" check from warning-levels (3.54 KB, patch)
2013-10-17 12:53 UTC, Bastien Nocera
committed Details | Review
power: Stop the alert sound before taking action (2.96 KB, patch)
2013-10-17 12:53 UTC, Bastien Nocera
committed Details | Review
power: Overriding GSD_ACTION_DELAY doesn't do anything (938 bytes, patch)
2013-10-17 12:53 UTC, Bastien Nocera
committed Details | Review
power: Set on_low_battery when the warning level changes (2.61 KB, patch)
2013-10-17 12:53 UTC, Bastien Nocera
committed Details | Review
power: Hide notifications when the warning level changes (2.30 KB, patch)
2013-10-17 12:53 UTC, Bastien Nocera
committed Details | Review
power: Only listen to lid-is-closed changing (1.62 KB, patch)
2013-10-17 12:53 UTC, Bastien Nocera
committed Details | Review
power: Update for libupower-glib API changes (1.91 KB, patch)
2013-10-17 12:53 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2013-10-09 14:54:38 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).
Comment 1 Bastien Nocera 2013-10-09 14:54:41 UTC
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)
Comment 2 Bastien Nocera 2013-10-09 14:54:46 UTC
Created attachment 256817 [details] [review]
power: Remove unused Percentage property

As gnome-shell will use the percentage from the primary device instead.
Comment 3 Rui Matos 2013-10-11 16:34:02 UTC
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.
Comment 4 Rui Matos 2013-10-11 16:44:56 UTC
Review of attachment 256817 [details] [review]:

Looks good
Comment 5 Rui Matos 2013-10-11 16:53:25 UTC
Seems like we can remove the Icon property too (bug 709925).
Comment 6 Bastien Nocera 2013-10-16 20:50:37 UTC
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.
Comment 7 Bastien Nocera 2013-10-16 20:50:42 UTC
Created attachment 257456 [details] [review]
power: Remove use of gpm_device_to_localised_string()

It was only ever called with a UPS device.
Comment 8 Bastien Nocera 2013-10-16 20:50:48 UTC
Created attachment 257457 [details] [review]
power: Remove unused helper functions
Comment 9 Bastien Nocera 2013-10-16 20:50:54 UTC
Created attachment 257458 [details] [review]
power: Use new "warning-level" property in UPower
Comment 10 Bastien Nocera 2013-10-16 20:51:00 UTC
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.
Comment 11 Bastien Nocera 2013-10-16 23:20:09 UTC
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.
Comment 12 Bastien Nocera 2013-10-17 12:52:11 UTC
Created attachment 257514 [details] [review]
power: Use up_client_get_critical_action()

To get the configured critical action.
Comment 13 Bastien Nocera 2013-10-17 12:52:16 UTC
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.
Comment 14 Bastien Nocera 2013-10-17 12:52:23 UTC
Created attachment 257516 [details] [review]
power: Don't do an action on critical battery

UPower does that for us.
Comment 15 Bastien Nocera 2013-10-17 12:52:28 UTC
Created attachment 257517 [details] [review]
power: Remove manager_critical{_ups,}_action_do_cb()

They didn't do anything different from the existing functions.
Comment 16 Bastien Nocera 2013-10-17 12:52:33 UTC
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.
Comment 17 Bastien Nocera 2013-10-17 12:52:38 UTC
Created attachment 257519 [details] [review]
power: Remove unused error checking
Comment 18 Bastien Nocera 2013-10-17 12:52:44 UTC
Created attachment 257520 [details] [review]
power: Use icon-names from UPower

Instead of our own.
Comment 19 Bastien Nocera 2013-10-17 12:52:49 UTC
Created attachment 257521 [details] [review]
power: Remove unused gpm_upower_get_device_icon()

We're using the icons from UPower now.
Comment 20 Bastien Nocera 2013-10-17 12:52:55 UTC
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.
Comment 21 Bastien Nocera 2013-10-17 12:53:01 UTC
Created attachment 257523 [details] [review]
power: Simplify engine_ups_discharging()

It's only ever called for UPS devices.
Comment 22 Bastien Nocera 2013-10-17 12:53:07 UTC
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.
Comment 23 Bastien Nocera 2013-10-17 12:53:13 UTC
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.
Comment 24 Bastien Nocera 2013-10-17 12:53:18 UTC
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.
Comment 25 Bastien Nocera 2013-10-17 12:53:24 UTC
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.
Comment 26 Bastien Nocera 2013-10-17 12:53:30 UTC
Created attachment 257528 [details] [review]
power: Set on_low_battery when the warning level changes
Comment 27 Bastien Nocera 2013-10-17 12:53:35 UTC
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.
Comment 28 Bastien Nocera 2013-10-17 12:53:41 UTC
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.
Comment 29 Bastien Nocera 2013-10-17 12:53:46 UTC
Created attachment 257531 [details] [review]
power: Update for libupower-glib API changes
Comment 30 Bastien Nocera 2013-10-17 15:43:21 UTC
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