diff options
author | JP Rosevear <jpr@ximian.com> | 2004-01-16 01:15:19 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2004-01-16 01:15:19 +0800 |
commit | c1f42ab2b0820cd1b52dc75ab1e7dfdaae6d604c (patch) | |
tree | 34fb84945b4a87679325241024f5a8723ca3c881 /calendar/gui/calendar-component.c | |
parent | 6dc6126ad803ecb3465a3f429078f36544182900 (diff) | |
download | gsoc2013-evolution-c1f42ab2b0820cd1b52dc75ab1e7dfdaae6d604c.tar.gz gsoc2013-evolution-c1f42ab2b0820cd1b52dc75ab1e7dfdaae6d604c.tar.zst gsoc2013-evolution-c1f42ab2b0820cd1b52dc75ab1e7dfdaae6d604c.zip |
update protos
2004-01-15 JP Rosevear <jpr@ximian.com>
* gui/tasks-component.h: update protos
* gui/tasks-component.c (impl_finalize): free base dir
(impl_upgradeFromVersion): just call migrate_tasks
(tasks_component_init): set base dir value
(tasks_component_peek_base_directory): accessor
(tasks_component_peek_source_list): ditto
* gui/migration.c (process_old_dir): look for a source with the
name and fallback to creating it
(create_calendar_contact_source): create the contacts:// source
(create_calendar_sources): use above and create all the necessary
sources
(create_task_sources): create all the necessary sources
(migrate_calendars): do all the migration logic here, upgrade
bonobo-conf to gconf
(migrate_tasks): ditto
* gui/calendar-component.h: update prototypes
* gui/calendar-component.c (impl_finalize): free the base
directory
(impl_upgradeFromVersion): just call migrate_calendars
(calendar_component_init): fill in base dir value
(calendar_component_peek_base_directory): accessor
(calendar_component_peek_source_list): ditto
svn path=/trunk/; revision=24248
Diffstat (limited to 'calendar/gui/calendar-component.c')
-rw-r--r-- | calendar/gui/calendar-component.c | 82 |
1 files changed, 16 insertions, 66 deletions
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c index 19fe36ff17..2158f2a32d 100644 --- a/calendar/gui/calendar-component.c +++ b/calendar/gui/calendar-component.c @@ -59,6 +59,7 @@ static BonoboObjectClass *parent_class = NULL; struct _CalendarComponentPrivate { + char *base_directory; char *config_directory; GConfClient *gconf_client; @@ -449,8 +450,8 @@ impl_finalize (GObject *object) { CalendarComponentPrivate *priv = CALENDAR_COMPONENT (object)->priv; + g_free (priv->base_directory); g_free (priv->config_directory); - g_free (priv); (* G_OBJECT_CLASS (parent_class)->finalize) (object); @@ -466,73 +467,9 @@ impl_upgradeFromVersion (PortableServer_Servant servant, CORBA_short revision, CORBA_Environment *ev) { - 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) { - /* create the local source group */ - group = e_source_group_new (_("On This Computer"), base_uri); - e_source_list_add_group (priv->source_list, group, -1); - - /* create the remote source group */ - group = e_source_group_new (_("On The Web"), "webcal://"); - e_source_list_add_group (priv->source_list, group, -1); - e_source_list_sync (priv->source_list, NULL); - } - - 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); - if (!e_mkdir_hier (new_dir, 0700)) { - source = e_source_new (_("Personal"), "Personal"); - e_source_group_add_source (group, source, -1); - } - g_free (new_dir); - - new_dir = g_build_filename (base_uri, "Work/", NULL); - if (!e_mkdir_hier (new_dir, 0700)) { - source = e_source_new (_("Work"), "Work"); - e_source_group_add_source (group, source, -1); - } - 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); - - e_source_list_sync (priv->source_list, NULL); - } - - /* create calendar for birthdays & anniversaries */ - if ((major < 0) || - ((major == 1) && (minor < 5)) || - ((major == 1) && (minor == 5) && (revision < 2))) { - group = e_source_group_new (_("Contacts"), "contacts://"); - source = e_source_new (_("Birthdays & Anniversaries"), "/"); - e_source_group_add_source (group, source, -1); - e_source_group_set_readonly (group, TRUE); - e_source_list_add_group (priv->source_list, group, -1); - e_source_list_sync (priv->source_list, NULL); - } - - g_free (base_uri); + migrate_calendars (calendar_component, major, minor, revision); return CORBA_TRUE; } @@ -848,6 +785,7 @@ calendar_component_init (CalendarComponent *component) priv = g_new0 (CalendarComponentPrivate, 1); + priv->base_directory = g_build_filename (g_get_home_dir (), ".evolution", NULL); priv->config_directory = g_build_filename (g_get_home_dir (), ".evolution", "calendar", "config", NULL); @@ -888,11 +826,23 @@ calendar_component_peek (void) } const char * +calendar_component_peek_base_directory (CalendarComponent *component) +{ + return component->priv->base_directory; +} + +const char * calendar_component_peek_config_directory (CalendarComponent *component) { return component->priv->config_directory; } +ESourceList * +calendar_component_peek_source_list (CalendarComponent *component) +{ + return component->priv->source_list; +} + EActivityHandler * calendar_component_peek_activity_handler (CalendarComponent *component) { |