gnome-calendar:gnome-3-38

Last commit made on 2021-10-06
Get this branch:
git clone -b gnome-3-38 https://git.launchpad.net/gnome-calendar

Branch merges

Branch information

Name:
gnome-3-38
Repository:
lp:gnome-calendar

Recent commits

9085895... by Danial Behzadi

Update Persian translation

5de66f8... by Źmicier

Update Belarusian translation

dad733a... by Źmicier

Update Belarusian translation

8514bf7... by Jordan Petridis <email address hidden>

3.38.2

fc96b55... by Kjartan Maraas

Update Norwegian Bokmål translation

c3bf09e... by Daniel Șerbănescu

Update Romanian translation

7dcaec5... by Fabio Tomat <email address hidden>

Update Friulian translation

93e01c5... by Fabio Tomat <email address hidden>

Update Friulian translation

2342882... by Michael Catanzaro

gcal-timeline: completed_calendars should be unsigned

In on_calendar_monitor_completed_cb() we have this assert:

g_assert (self->completed_calendars <= g_hash_table_size (self->calendars));

That is comparing a signed integer to unsigned. This is dangerous. We
could add casts to say that we really want to do it, but
completed_calendars should never be negative, so might as well use
unsigned.

(cherry picked from commit 9ac1528e54531006c936b64d3a5f50214e91e33c)

7877536... by Michael Catanzaro

gcal-timeline: never reset completed_calendars

Since 78cb11c64d199b77761ba55bdd3d3e6b0dcb06af, GcalCalendarMonitor now
notifies when a completed calendar transitions to incomplete, and
GcalTimeline decrements its completed_calendars counter. But we forgot
to remove the code that resets completed_calendars when previously
needed. That's not required anymore, because we can trust
GcalCalendarMonitor to do the right thing.

In my case, I have 5 calendars enabled and 6 total. When starting
gnome-calendar, all 5 are successively completed, and
completed_calendars increments from 0 -> 1 -> 2 -> 3 -> 4 -> 5. Then,
when transitioning month view from January 2020 to December 2019, we
call reset_completed_calendars() and completed_calenders gets clobbered
to 0. Then it decrements from 0 -> -1 -> -2 -> -3 -> -4 -> -5 as the
GcalCalendarMonitors notify that they are no longer completed. Well,
that is what would happen, if it didn't crash when decrementing to -1.
We assert -1 <= 6 (the total number of calendars) and crash because -1
gets promoted to a huge unsigned int, since we're comparing signed to
unsigned. (That crash would have been avoided if we used
-Wsign-compare, although that warning would not have caught the logic
problem.)

Anyway, since GcalMonitor now notifies when calendars are no longer
complete, it is safe to simply remove reset_completed_calendars().
GcalTimeline will still notify if it needs to change its own complete
property (in on_calendar_monitor_completed_cb).

Fixes #567
Fixes #636
Fixes #638
Fixes #647
Fixes #650

(cherry picked from commit c2c89b667e99cc5248da9a632db534a9c94193e3)