From a9a98b2bd2535b94193a8a98da9fe67d211cf160 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 4 Jul 2008 07:19:48 +0000 Subject: ** Fix for bug #368038 2008-07-04 Milan Crha ** Fix for bug #368038 * gui/calendar-component.c: (ensure_sources): Ensure only one Birthdays & Anniversaries source. svn path=/trunk/; revision=35721 --- calendar/gui/calendar-component.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'calendar/gui') diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c index 4916bccfeb..5941ff6962 100644 --- a/calendar/gui/calendar-component.c +++ b/calendar/gui/calendar-component.c @@ -278,8 +278,22 @@ ensure_sources (CalendarComponent *component) } if (contacts) { GSList *sources = e_source_group_peek_sources (contacts); - if (sources) + if (sources) { birthdays_source = E_SOURCE (sources->data); /* There is only one source under Contacts Group*/ + + if (sources->next) { + /* Ensure we have only one contacts source - we was able to create more than one before */ + GSList *l = NULL, *p; + + for (p = sources->next; p; p = p->next) + l = g_slist_prepend (l, p->data); + + for (p = l; p; p = p->next) + e_source_group_remove_source (contacts, p->data); + + g_slist_free (l); + } + } } else { /* Create the contacts group */ -- cgit v1.2.3