Bug 382069 - Time remaining shows 0:60 (0 hours, 60 minutes) > expecting 1:00 (1 hour, 0 minutes)
Summary: Time remaining shows 0:60 (0 hours, 60 minutes) > expecting 1:00 (1 hour, 0 m...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Battery Monitor (show other bugs)
Version: 5.10.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Kai Uwe Broulik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-06 17:41 UTC by wutr
Modified: 2017-07-07 11:46 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot of battery endurance remaining showing 0 hours 60 minutes (0:60) (2.49 MB, image/png)
2017-07-06 17:41 UTC, wutr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wutr 2017-07-06 17:41:22 UTC
Created attachment 106468 [details]
Screenshot of battery endurance remaining showing 0 hours 60 minutes (0:60)

Difficult for me to duplicate as it of course depends on the current charge and load / expected load of the system. However it should be fixable in the source as there is clearly a problem with the conversion from minutes into hours.

Screenshot attached
Comment 1 David Edmundson 2017-07-07 11:46:22 UTC
Git commit 13675d6ab695ba3d1e621ae5493f66ee25e5091d by David Edmundson.
Committed on 06/07/2017 at 20:16.
Pushed by davidedmundson into branch 'master'.

Fix display of formatDuration with rounding.

Summary:
When showing the time (1 hour 59.5 minutes) with seconds hidden we
want to show "2 hours 0 minutes" not "1 hour 60 minutes".

This is fixed by performing the rounding before we split the number of
miliseconds into component parts, rather than splitting and then
rounding.
Related: bug 360681

Test Plan: Updated unit test

Subscribers: #frameworks

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D6537

M  +20   -0    autotests/kformattest.cpp
M  +14   -8    src/lib/util/kformatprivate.cpp

https://commits.kde.org/kcoreaddons/13675d6ab695ba3d1e621ae5493f66ee25e5091d