evolution r35721 - in trunk/calendar: . gui



Author: mcrha
Date: Fri Jul  4 07:19:48 2008
New Revision: 35721
URL: http://svn.gnome.org/viewvc/evolution?rev=35721&view=rev

Log:
2008-07-04  Milan Crha  <mcrha redhat com>

	** Fix for bug #368038

	* gui/calendar-component.c: (ensure_sources):
	Ensure only one Birthdays & Anniversaries source.



Modified:
   trunk/calendar/ChangeLog
   trunk/calendar/gui/calendar-component.c

Modified: trunk/calendar/gui/calendar-component.c
==============================================================================
--- trunk/calendar/gui/calendar-component.c	(original)
+++ trunk/calendar/gui/calendar-component.c	Fri Jul  4 07:19:48 2008
@@ -278,8 +278,22 @@
 	}
 	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 */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]