Bug 343872 - Digital clock offset by a few seconds compared to local time
Summary: Digital clock offset by a few seconds compared to local time
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Digital Clock (show other bugs)
Version: 5.2.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Martin Klapetek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-06 21:10 UTC by Médéric Boquien
Modified: 2015-02-16 17:48 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.3.0


Attachments
Screenshot showing the issue. (149.54 KB, image/png)
2015-02-06 21:12 UTC, Médéric Boquien
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Médéric Boquien 2015-02-06 21:10:56 UTC
The clock is offset by a few seconds compared to the local time. It is as if (wild assumption) there was a timer to update it every minute but that timer would not be triggered at :00.

Reproducible: Always

Steps to Reproduce:
1. Have a digital clock


Actual Results:  
Time is offset by a few seconds.

Expected Results:  
Time is not offset.
Comment 1 Médéric Boquien 2015-02-06 21:12:03 UTC
Created attachment 90954 [details]
Screenshot showing the issue.
Comment 2 Médéric Boquien 2015-02-06 22:31:38 UTC
Bingo.
http://quickgit.kde.org/?p=plasma-workspace.git&a=blob&h=e78f1f369a45447cea32483eab80dc8508145a4b&hb=e42e123948e8f44a5807873349764250b0d9cbec&f=applets%2Fdigital-clock%2Fpackage%2Fcontents%2Fui%2Fmain.qml#l45
If I understood correctly line 45 (which is not a given as it is the first time in my life i see QML), the clock is updated every 30 seconds, which means it can be up to 15 seconds off. It would need a one-shot update at startup (as KDE 4 did I guess) before switching to an interval update.

Thanks!
Comment 3 David Edmundson 2015-02-07 09:13:23 UTC
>as KDE 4 did I guess

Sort of.

DataEngine::connectToSource() has an argument intervalAlignment, 
which for the clock was Plasma::AlignToMinute

that's not available in the QML bindings for dataengines.

I'm not sure if there's a use case outside the clock for it; we could fix it generically for engines; or just in the clock.
Comment 4 Martin Klapetek 2015-02-12 13:19:58 UTC
Patch currently under review https://git.reviewboard.kde.org/r/122470/
Comment 5 Kai Uwe Broulik 2015-02-16 17:48:53 UTC
Git commit 7de7fb53b0b779e197c893a5da3a8f510dd09d6d by Kai Uwe Broulik.
Committed on 16/02/2015 at 17:46.
Pushed by broulik into branch 'master'.

Align digital clock to full minutes

This also allows to increase the polling interval to 60 seconds

REVIEW: 122592
FIXED-IN: 5.3.0

M  +2    -1    applets/digital-clock/package/contents/ui/main.qml

http://commits.kde.org/plasma-workspace/7de7fb53b0b779e197c893a5da3a8f510dd09d6d