Skip to content

kclockd daemon for KClock front end

Ghost User requested to merge (removed):kclockd into master

This MR literally divide kclock into two application. Almost half the c++ are re-written, so gitlab diff provides little information. I highly recommend clone the branch to review it in your favourite IDE.

motivation

From logic aspect, the previous kclock is actually doing two things - keeping track of time and providing a UI. For applications like Instant Messaging this approach makes sense, user will check the app frequently so the UI will be visited often. However, for a clock app like kclock, keeping the UI alive provides little benefit. At least for myself, I only use clock app twice a day - morning to disarm alarm and night to check if I set alarm for tomorrow. We've found kclock consumes a portion of memory and cpu. On pinephone, this is noticeable.

So this MR creates a new app called kclockd, a daemon for kclock running in background. Kclockd's performance is a lot better than keep the original kclock running in the background, the memory usage is much lower.

structure changes

  • The original kclock has been moved to src/kclock, and the app in src/ is called kclockd.

other changes

  • Switched Timer to use block time tracking as we did to Alarm earlier.
  • Timer precision is now seconds not milliseconds, since users use timer as kitchen timer not stopwatch.
  • We now use UUID to distinguish Timers from each other, just as Alarms.
  • If kclock isn't focused stop all animation, this behavior is weird on desktop where you can have multiple window on screen. But think if you're on mobile only one screen is displayed at a time, considering pinephone's limited performance on animation, performance should be top one priority. Stop animation almost makes kclock into suspend mode.

things not done in this MR

  • haven't change the plasmoid to use new D-Bus path, will do in another MR to make this MR not so messy
  • there is a bug in kclockd, alarm notification not showing. For detailed info see src/alarms.h cpp
  • kclock will not display ringtone name, I'm waiting for default ringtone ships with kclock and KDE sound subsystem(if possible)
Edited by Ghost User

Merge request reports