https://bugs.kde.org/show_bug.cgi?id=511293

Vlad Zahorodnii <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Latest Commit|                            |https://invent.kde.org/plas
                   |                            |ma/knighttime/-/commit/ce36
                   |                            |931b53817c761540d099646b71c
                   |                            |6458300d7
         Resolution|---                         |FIXED

--- Comment #2 from Vlad Zahorodnii <[email protected]> ---
Git commit ce36931b53817c761540d099646b71c6458300d7 by Vlad Zahorodnii.
Committed on 29/10/2025 at 09:21.
Pushed by vladz into branch 'master'.

Fix daylight duration with flipped morning and evening times

If the evening time is before the morning time, QTime::secsTo() will
return a negative value. In that case, morning.secsTo(evening) is going
to actualy specify the time between evening and morning. For example,
witb the following times

  - evening: 1:00 AM
  - morning: 6:00 AM

morning.secsTo(evening) is going to return -18000, which is not what we
really expect. The issue can be addressed by applying a modulo operator.
But in order to make the code slightly more readable, this change goes
with an explicit "seconds in a day - time from evening to morning" formula.

M  +39   -16   autotests/schedule_test.cpp
M  +11   -1    src/kdarklightschedule.cpp

https://invent.kde.org/plasma/knighttime/-/commit/ce36931b53817c761540d099646b71c6458300d7

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to