calendars-page: Remove previously deleted calendar if any

It is possible to delete a calendar, and immediately delete another.
When that happens, both should be deleted.
This commit is contained in:
Georges Basile Stavracas Neto
2019-06-24 21:33:00 -03:00
parent 39ebc5457a
commit 7da3197186
@@ -374,6 +374,14 @@ gcal_calendars_page_activate (GcalCalendarManagementPage *page,
GCAL_RETURN ();
self = GCAL_CALENDARS_PAGE (page);
/* Remove the previously deleted calendar, if any */
if (self->removed_calendar)
{
delete_calendar (self, self->removed_calendar);
g_clear_object (&self->removed_calendar);
}
calendar = GCAL_CALENDAR (page_data);
self->removed_calendar = g_object_ref (calendar);