aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-component.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2008-07-04 15:19:48 +0800
committerMilan Crha <mcrha@src.gnome.org>2008-07-04 15:19:48 +0800
commita9a98b2bd2535b94193a8a98da9fe67d211cf160 (patch)
tree713db68c3330749c1312281abd9b8f61a2ac19e0 /calendar/gui/calendar-component.c
parent815a25a6a1fa8b2fd8aa5a475612600f1e1767ff (diff)
downloadgsoc2013-evolution-a9a98b2bd2535b94193a8a98da9fe67d211cf160.tar.gz
gsoc2013-evolution-a9a98b2bd2535b94193a8a98da9fe67d211cf160.tar.zst
gsoc2013-evolution-a9a98b2bd2535b94193a8a98da9fe67d211cf160.zip
** Fix for bug #368038
2008-07-04 Milan Crha <mcrha@redhat.com> ** Fix for bug #368038 * gui/calendar-component.c: (ensure_sources): Ensure only one Birthdays & Anniversaries source. svn path=/trunk/; revision=35721
Diffstat (limited to 'calendar/gui/calendar-component.c')
-rw-r--r--calendar/gui/calendar-component.c16
1 files changed, 15 insertions, 1 deletions
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 */