Merge lp:~seb128/ubuntu-system-settings/battery-charge-hours into lp:ubuntu-system-settings

Proposed by Sebastien Bacher
Status: Merged
Approved by: Jonas G. Drange
Approved revision: 1393
Merged at revision: 1409
Proposed branch: lp:~seb128/ubuntu-system-settings/battery-charge-hours
Merge into: lp:ubuntu-system-settings
Diff against target: 26 lines (+2/-6)
1 file modified
plugins/battery/PageComponent.qml (+2/-6)
To merge this branch: bzr merge lp:~seb128/ubuntu-system-settings/battery-charge-hours
Reviewer Review Type Date Requested Status
Jonas G. Drange (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+256897@code.launchpad.net

Commit message

[battery] display last charge info in hours rather than days

Description of the change

[battery] display last charge info in hours rather than days

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Jonas G. Drange (jonas-drange) wrote :

Nice, thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/battery/PageComponent.qml'
2--- plugins/battery/PageComponent.qml 2015-04-20 15:47:53 +0000
3+++ plugins/battery/PageComponent.qml 2015-04-21 09:56:23 +0000
4@@ -38,20 +38,16 @@
5 function timeDeltaString(timeDelta) {
6 var sec = timeDelta,
7 min = Math.round (timeDelta / 60),
8- hr = Math.round (timeDelta / 3600),
9- day = Math.round (timeDelta / 86400);
10+ hr = Math.round (timeDelta / 3600);
11 if (sec < 60)
12 // TRANSLATORS: %1 is the number of seconds
13 return i18n.tr("%1 second ago", "%1 seconds ago", sec).arg(sec)
14 else if (min < 60)
15 // TRANSLATORS: %1 is the number of minutes
16 return i18n.tr("%1 minute ago", "%1 minutes ago", min).arg(min)
17- else if (hr < 24)
18+ else
19 // TRANSLATORS: %1 is the number of hours
20 return i18n.tr("%1 hour ago", "%1 hours ago", hr).arg(hr)
21- else
22- // TRANSLATORS: %1 is the number of days
23- return i18n.tr("%1 day ago", "%1 days ago", day).arg(day)
24 }
25
26 GSettings {

Subscribers

People subscribed via source and target branches