diff options
-rw-r--r-- | calendar/ChangeLog | 7 | ||||
-rw-r--r-- | calendar/gui/calendar-component.c | 32 | ||||
-rw-r--r-- | calendar/gui/tasks-component.c | 26 |
3 files changed, 42 insertions, 23 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index ffeab4aabc..1e44420f73 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,10 @@ +2004-01-09 Rodrigo Moya <rodrigo@ximian.com> + + * gui/calendar-component.c (impl_upgradeFromVersion): only migrate + old calendars if migrating from <= 1.4.x. + + * gui/tasks-component.c (impl_upgradeFromVersion): ditto for tasks. + 2004-01-09 Andrew Wu <Yang.Wu@sun.com> * gui/e-cal-view.c (e_calendar_view_class_init): diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c index 0b94bee562..8a6e3b116e 100644 --- a/calendar/gui/calendar-component.c +++ b/calendar/gui/calendar-component.c @@ -515,25 +515,33 @@ impl_upgradeFromVersion (PortableServer_Servant servant, { CalendarComponentPrivate *priv; GSList *groups; + ESourceGroup *group; + ESource *source; + char *base_uri, *new_dir; CalendarComponent *calendar_component = CALENDAR_COMPONENT (bonobo_object_from_servant (servant)); priv = calendar_component->priv; + base_uri = g_build_filename (g_get_home_dir (), + "/.evolution/calendar/local/OnThisComputer/", + NULL); + /* create default calendars if there are no groups */ groups = e_source_list_peek_groups (priv->source_list); if (!groups) { - ESourceGroup *group; - ESource *source; - char *base_uri, *new_dir; - /* create the local source group */ - base_uri = g_build_filename (g_get_home_dir (), - "/.evolution/calendar/local/OnThisComputer/", - NULL); group = e_source_group_new (_("On This Computer"), base_uri); e_source_list_add_group (priv->source_list, group, -1); - /* migrate calendars from older setup */ + /* create the remote source group */ + group = e_source_group_new (_("On The Web"), "webcal://"); + e_source_list_add_group (priv->source_list, group, -1); + } + + if (major == 1 && minor <= 4) { + group = e_source_list_peek_group_by_name (priv->source_list, _("On This Computer")); + + /* migrate calendars from 1.4 setup */ if (!migrate_old_calendars (group)) { /* create default calendars */ new_dir = g_build_filename (base_uri, "Personal/", NULL); @@ -550,13 +558,11 @@ impl_upgradeFromVersion (PortableServer_Servant servant, } g_free (new_dir); } + } - /* create the remote source group */ - group = e_source_group_new (_("On The Web"), "webcal://"); - e_source_list_add_group (priv->source_list, group, -1); + g_free (base_uri); - g_free (base_uri); - } + return TRUE; } static void diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c index 55eef10dc2..bdddc54ade 100644 --- a/calendar/gui/tasks-component.c +++ b/calendar/gui/tasks-component.c @@ -492,7 +492,7 @@ impl_finalize (GObject *object) /* Evolution::Component CORBA methods */ -static void +static CORBA_boolean impl_upgradeFromVersion (PortableServer_Servant servant, CORBA_short major, CORBA_short minor, @@ -501,23 +501,27 @@ impl_upgradeFromVersion (PortableServer_Servant servant, { TasksComponentPrivate *priv; GSList *groups; + ESourceGroup *group; + ESource *source; + char *base_uri, *new_dir; TasksComponent *component = TASKS_COMPONENT (bonobo_object_from_servant (servant)); priv = component->priv; + base_uri = g_build_filename (g_get_home_dir (), + ".evolution/tasks/local/OnThisComputer/", + NULL); + /* create default tasks folders if there are no groups */ groups = e_source_list_peek_groups (priv->source_list); if (!groups) { - ESourceGroup *group; - ESource *source; - char *base_uri, *new_dir; - /* create the source group */ - base_uri = g_build_filename (g_get_home_dir (), - ".evolution/tasks/local/OnThisComputer/", - NULL); group = e_source_group_new (_("On This Computer"), base_uri); e_source_list_add_group (priv->source_list, group, -1); + } + + if (major == 1 && minor <= 4) { + group = e_source_list_peek_group_by_name (priv->source_list, _("On This Computer")); /* migrate tasks from older setup */ if (!migrate_old_tasks (group)) { @@ -530,9 +534,11 @@ impl_upgradeFromVersion (PortableServer_Servant servant, g_free (new_dir); } - - g_free (base_uri); } + + g_free (base_uri); + + return TRUE; } static void |