diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2004-01-10 02:13:29 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2004-01-10 02:13:29 +0800 |
commit | b2fdc68fd71c0a1fb81c8bb1f7c52896ec5167d7 (patch) | |
tree | 5a419ce62c9aad43af57687ddb375a70e66ab6d2 /calendar/gui | |
parent | 3210901be7ecd194f2bb8a63b178a6b2b15dfb84 (diff) | |
download | gsoc2013-evolution-b2fdc68fd71c0a1fb81c8bb1f7c52896ec5167d7.tar gsoc2013-evolution-b2fdc68fd71c0a1fb81c8bb1f7c52896ec5167d7.tar.gz gsoc2013-evolution-b2fdc68fd71c0a1fb81c8bb1f7c52896ec5167d7.tar.bz2 gsoc2013-evolution-b2fdc68fd71c0a1fb81c8bb1f7c52896ec5167d7.tar.lz gsoc2013-evolution-b2fdc68fd71c0a1fb81c8bb1f7c52896ec5167d7.tar.xz gsoc2013-evolution-b2fdc68fd71c0a1fb81c8bb1f7c52896ec5167d7.tar.zst gsoc2013-evolution-b2fdc68fd71c0a1fb81c8bb1f7c52896ec5167d7.zip |
only migrate old calendars if migrating from <= 1.4.x.
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.
svn path=/trunk/; revision=24132
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/calendar-component.c | 32 | ||||
-rw-r--r-- | calendar/gui/tasks-component.c | 26 |
2 files changed, 35 insertions, 23 deletions
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 |