diff options
Diffstat (limited to 'calendar/gui/calendar-component.c')
-rw-r--r-- | calendar/gui/calendar-component.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c index f077199fa6..38bd178156 100644 --- a/calendar/gui/calendar-component.c +++ b/calendar/gui/calendar-component.c @@ -241,12 +241,14 @@ ensure_sources (CalendarComponent *component) if (!personal_source) { char *primary_calendar = calendar_config_get_primary_calendar(); + GSList *calendars_selected; /* Create the default Person addressbook */ personal_source = e_source_new (_("Personal"), PERSONAL_RELATIVE_URI); e_source_group_add_source (on_this_computer, personal_source, -1); - if (!primary_calendar && !calendar_config_get_calendars_selected ()) { + calendars_selected = calendar_config_get_calendars_selected (); + if (!primary_calendar && !calendars_selected) { GSList selected; calendar_config_set_primary_calendar (e_source_peek_uid (personal_source)); @@ -256,6 +258,11 @@ ensure_sources (CalendarComponent *component) calendar_config_set_calendars_selected (&selected); } + if (calendars_selected) { + g_slist_foreach (calendars_selected, (GFunc) g_free, NULL); + g_slist_free (calendars_selected); + } + g_free (primary_calendar); e_source_set_color_spec (personal_source, "#BECEDD"); } @@ -465,6 +472,11 @@ update_task_memo_selection (CalendarComponentView *component_view, ECalSourceTyp component_view->task_source_selection = uids_selected; else component_view->memo_source_selection = uids_selected; + + if (uids_selected) { + g_slist_foreach (uids_selected, (GFunc) g_free, NULL); + g_slist_free (uids_selected); + } } static void |