From 8b75e649855ed12734874ea46b2a81135c4ac626 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Tue, 23 Mar 2004 16:55:11 +0000 Subject: ensure that only one Personal calendar/task list gets created when moving 2004-03-23 JP Rosevear * gui/migration.c (create_calendar_sources, create_task_sources): ensure that only one Personal calendar/task list gets created when moving between minor versions svn path=/trunk/; revision=25160 --- calendar/gui/migration.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/migration.c b/calendar/gui/migration.c index a960e10e0a..979c4822af 100644 --- a/calendar/gui/migration.c +++ b/calendar/gui/migration.c @@ -382,9 +382,13 @@ create_calendar_sources (CalendarComponent *component, { GSList *groups; ESourceGroup *group; - ESource *source = NULL; char *base_uri, *base_uri_proto; - + + *on_this_computer = NULL; + *on_the_web = NULL; + *contacts = NULL; + *personal_source = NULL; + base_uri = g_build_filename (calendar_component_peek_base_directory (component), "/calendar/local/", NULL); @@ -429,9 +433,9 @@ create_calendar_sources (CalendarComponent *component, *on_this_computer = group; } - if (!source) { - /* Create the default Person addressbook */ - source = e_source_new (_("Personal"), PERSONAL_RELATIVE_URI); + if (!*personal_source) { + /* Create the default Person calendar */ + ESource *source = e_source_new (_("Personal"), PERSONAL_RELATIVE_URI); e_source_group_add_source (*on_this_computer, source, -1); *personal_source = source; @@ -463,8 +467,10 @@ create_task_sources (TasksComponent *component, { GSList *groups; ESourceGroup *group; - ESource *source = NULL; char *base_uri, *base_uri_proto; + + *on_this_computer = NULL; + *personal_source = NULL; base_uri = g_build_filename (tasks_component_peek_base_directory (component), "/tasks/local/", @@ -506,9 +512,9 @@ create_task_sources (TasksComponent *component, *on_this_computer = group; } - if (!source) { - /* Create the default Person addressbook */ - source = e_source_new (_("Personal"), PERSONAL_RELATIVE_URI); + if (!*personal_source) { + /* Create the default Person task list */ + ESource *source = e_source_new (_("Personal"), PERSONAL_RELATIVE_URI); e_source_group_add_source (*on_this_computer, source, -1); *personal_source = source; -- cgit