Merge lp:~1vd1jn0oc/indicator-power/primary-battery-fix into lp:~jjardon/indicator-power/master

Proposed by David Schlenk
Status: Rejected
Rejected by: Javier Jardón
Proposed branch: lp:~1vd1jn0oc/indicator-power/primary-battery-fix
Merge into: lp:~jjardon/indicator-power/master
Diff against target: 24 lines (+3/-3)
1 file modified
src/indicator-power.c (+3/-3)
To merge this branch: bzr merge lp:~1vd1jn0oc/indicator-power/primary-battery-fix
Reviewer Review Type Date Requested Status
Charles Kerr (community) Disapprove
Javier Jardón Pending
Review via email: mp+86340@code.launchpad.net

Description of the change

Changes the method of determining the primary battery device from the device that has the least time left in terms of charge remaining, to the one with the most. I personally don't care if my tiny second battery has run down if the big main one has 3 hours left on it. Alternatives would be to show charge level as a sum of all devices or display a meter for each device present. This being a ~12 character patch is a good start IMO.

To post a comment you must log in.
Revision history for this message
Charles Kerr (charlesk) wrote :

Hm, on the one hand, I like this patch. On the other hand, the design spec's update now details what we should do when >1 battery is present, and this patch doesn't follow the spec any more than the current behavior does.

review: Disapprove
Revision history for this message
Charles Kerr (charlesk) wrote :

Ah, NVM, didn't see this was proposed for jjardon's branch. Please ignore my meddling :)

Unmerged revisions

124. By David Schlenk <email address hidden>

Instead of picking the primary battery device by which has the least time
left in terms of charge remaining, pick the one with the most. I don't care
if my tiny second battery has run down if the big main one has 3 hours left
on it. YMMV.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/indicator-power.c'
2--- src/indicator-power.c 2011-11-08 21:38:58 +0000
3+++ src/indicator-power.c 2011-12-20 06:22:25 +0000
4@@ -620,7 +620,7 @@
5 gchar *device_icon;
6 gdouble percentage;
7 guint64 time;
8- guint64 min_discharging_time = G_MAXUINT64;
9+ guint64 max_discharging_time = 0;
10 guint64 max_charging_time = 0;
11 gsize n_devices;
12 guint i;
13@@ -655,9 +655,9 @@
14 if (state == UP_DEVICE_STATE_DISCHARGING)
15 {
16 discharging = TRUE;
17- if (time < min_discharging_time)
18+ if (time > max_discharging_time)
19 {
20- min_discharging_time = time;
21+ max_discharging_time = time;
22 primary_device_discharging = device;
23 }
24 }

Subscribers

People subscribed via source and target branches

to all changes: