aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog7
-rw-r--r--calendar/gui/calendar-component.c16
2 files changed, 22 insertions, 1 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 8890121ca9..82dc32ab48 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,10 @@
+2008-07-04 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #368038
+
+ * gui/calendar-component.c: (ensure_sources):
+ Ensure only one Birthdays & Anniversaries source.
+
2008-07-03 Milan Crha <mcrha@redhat.com>
** Fix for bug #540152
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 */