Bug 360681 - Battery monitor shows 0:60 instead of 1:00 for remaining battery
Summary: Battery monitor shows 0:60 instead of 1:00 for remaining battery
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kcoreaddons
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: Michael Pyne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-18 01:54 UTC by Malte Eggers
Modified: 2017-07-07 11:46 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot showing the bug (17.36 KB, image/png)
2016-03-30 22:01 UTC, Andrea Arteaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Malte Eggers 2016-03-18 01:54:27 UTC
I just observed this, obviously it's difficult to reproduce. Also I'm not sure if this is the right component.

Reproducible: Always
Comment 1 Andrea Arteaga 2016-03-30 22:01:38 UTC
Created attachment 98162 [details]
Screenshot showing the bug

I noticed the bug today and made a screenshot. The message "0:60 remaining" is very confusing.
Comment 2 Andrea Arteaga 2016-03-30 22:06:23 UTC
(In reply to Andrea Arteaga from comment #1)
> Created attachment 98162 [details]
> Screenshot showing the bug
> 
> I noticed the bug today and made a screenshot. The message "0:60 remaining"
> is very confusing.

By the way, I'm on Fedora 23. PowerDevil shows "Revision KDE 4.11 (2013-08-18)". I have Plasma 5.5.5.
Comment 3 Kai Uwe Broulik 2016-03-30 22:17:19 UTC
It's using kcoreaddons (iirc) to format the duration. Perhaps some rounding error there?

Also, I don't consider running Plasma 5 with PowerDevil 4 a supported setup.
Comment 4 Andrea Arteaga 2016-03-30 23:24:38 UTC
I was just reporting what I found on the help page I have on my system. After a closer look I realized I actually have PowerDevil 5.5.5. I probably landed on an outdated page...
Comment 5 Rolf Eike Beer 2017-04-07 17:13:47 UTC
I've seen the same on openSUSE.
Comment 6 David Edmundson 2017-07-07 11:46:21 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 382069

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