[evolution-patches] patch for selecting default source when migrating (calendar)



As found by fcrozat
-- 
Rodrigo Moya <rodrigo novell com>
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2490
diff -u -p -r1.2490 ChangeLog
--- ChangeLog	18 Aug 2004 14:42:19 -0000	1.2490
+++ ChangeLog	23 Aug 2004 15:48:15 -0000
@@ -1,3 +1,41 @@
+2004-08-23  Rodrigo Moya <rodrigo novell com>
+
+	* gui/migration.c (create_calendar_sources): make sure the default
+	calendar is checked when no other calendars are.
+	(create_tasks_sources): ditto for tasks.
+
 2004-08-18  Sivaiah Nallagatla <snallagatla novell com>
 
 	* gui/alarm-notify/alarm-notify.c (alarm-notify_init) :
Index: gui/migration.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/migration.c,v
retrieving revision 1.30
diff -u -p -r1.30 migration.c
--- gui/migration.c	22 Jul 2004 03:02:08 -0000	1.30
+++ gui/migration.c	23 Aug 2004 15:48:16 -0000
@@ -46,6 +46,7 @@
 #include <e-util/e-folder-map.h>
 #include <libedataserver/e-dbhash.h>
 #include <libedataserver/e-xml-hash-utils.h>
+#include "calendar-config.h"
 #include "calendar-config-keys.h"
 #include "migration.h"
 
@@ -394,7 +395,7 @@ create_calendar_sources (CalendarCompone
 			 ESourceGroup **on_the_web,
 			 ESourceGroup **contacts)
 {
-	GSList *groups;
+	GSList *groups, *uids_selected;
 	ESourceGroup *group;
 	char *base_uri, *base_uri_proto;
 
@@ -474,7 +475,18 @@ create_calendar_sources (CalendarCompone
 
 		*contacts = group;
 	}
-	
+
+	/* make sure we have the default calendar checked in for first time users */
+	if (!(uids_selected = calendar_config_get_calendars_selected ())) {
+		uids_selected = g_slist_append (NULL, e_source_peek_uid (*personal_source));
+		calendar_config_set_calendars_selected (uids_selected);
+
+		g_slist_free (uids_selected);
+	} else {
+		g_slist_foreach (uids_selected, (GFunc) g_free, NULL);
+		g_slist_free (uids_selected);
+	}
+
 	g_free (base_uri_proto);
 	g_free (base_uri);
 }
@@ -486,7 +498,7 @@ create_task_sources (TasksComponent *com
 		     ESourceGroup **on_the_web,
 		     ESource **personal_source)
 {
-	GSList *groups;
+	GSList *groups, *uids_selected;
 	ESourceGroup *group;
 	char *base_uri, *base_uri_proto;
 
@@ -549,6 +561,17 @@ create_task_sources (TasksComponent *com
 		e_source_list_add_group (source_list, group, -1);
 
 		*on_the_web = group;
+	}
+
+	/* make sure we have the default task checked in for first time users */
+	if (!(uids_selected = calendar_config_get_tasks_selected ())) {
+		uids_selected = g_slist_append (NULL, e_source_peek_uid (*personal_source));
+		calendar_config_set_tasks_selected (uids_selected);
+
+		g_slist_free (uids_selected);
+	} else {
+		g_slist_foreach (uids_selected, (GFunc) g_free, NULL);
+		g_slist_free (uids_selected);
 	}
 
 	g_free (base_uri_proto);


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