Using GDateTime utilities is costly and shows up high in profiling.
That's because GDateTime has to run timezone offset checks for every
comparison. We can amortize this cost by converting these datetimes
to unix timestamps upfront, and using them for comparisons.
A complication is date-only ranges, for which unix timestamps wouldn't
work. For this, add a new kind of timestamp that only accounts for the
dates.
Add a new test case for date-only comparison.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/770>
This is a GListModel implementation that is specific to
GcalEvents. Events are stored in a GSequence in order of
date.
Add a couple of tests exercising additions and removals.
WIP: add more tests
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/742>
Add a wrapper for the ECalComponentOrganizer. An instance of this type
is kept as part of the GcalEvent structure.
The GcalEventOrganizer is just a "proxy" to the ECalComponentAttendee
and its purpose is to unclutter the GcalEvent interface and provide a
bindable base for a UI widget.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/671>
Creates a chooser managing a GDateTime. The chooser allows the user
to change the date, the time and the timezone independently.
This replaces the precedent GcalTimeChooserRow widget, because it is
easier to manage the different interactions with the user in a single
widget.
Co-authored-by: Georges Basile Stavracas Neto
<georges.stavracas@gmail.com>
Create file to test util functions and create a test for the
gcal_date_time_from_icaltime function. The test checks if the time
zones are correctly interpreted in the conversion of an ICalTime to a
GDateTime.
This avoids some web servers or WAFs doing weird stuff with our requests
which would lead to situations where our web calendar source discovery
would face server errors, redirects, incorrect contents, etc.
Fixes#651
Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/290
This patch fixes an issue when creating new events in week view the week
after the daylight saving change.
The problem was in the calc of the selected date, that's done couting
the 30 minutes slots and adding that minutes to the week_start datetime.
When there's a daylight saving change, the real date to select should be
adjusted. This patch adds a new util function to make it easy to add
minutes ignoring the tz so we can make this calc directly with
gcal_date_time_add_floating_minutes.
This also includes a new test file with some checks for the new util
function and spring / autumn changes.
This new function could be used in other places to fix specific issues
that could be caused by the same logic error, calculate a selection or
event position based on GDateTime operations.
Fix https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/482
Zero length ranges, such as for events without a DTEND could be
considered to overlap a range if they were at exactly the end of the
range. The end of a range however is the first date that is supposed to
not overlap, so a zero-length range on exactly this point should not be
considered overlapping.
This fixes cases where all-day events from the next month could show up
on the same day of the current month if they did not have a DTEND.
This also adds tests for all possible cases of such zero-length events
overlapping.
Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/701
Using raw integers forces us to select a pre-defined
start and end ranges for the timeline. Since we want
to reuse this data structure on GcalTimeline, make it
a bit more useful.
The new source discoverer is a complete overhaul of
the current code. It is async-only, correctly threaded,
and easier to maintain.
A major new feature of this web source discoverer is
that it now pings the server to see if the URL feeds
us back with an iCalendar file.
Furthermore, it continues to use E-D-S WebDAV discovery
functions as a fallback mechanism.
Fixes#380
Introduce a new GcalStubCalendar class that essentially
removes the ECalClient initialization from GcalCalendar,
and use it as part of a new private library consumed by
the tests.