This adds a new event that is triggered at the calendar migration step (which occurs every time evolution starts). This allows plugins to supply their own source groups. -David
? calendar/gui/e-cal-event.c ? calendar/gui/e-cal-event.h Index: calendar/gui/Makefile.am =================================================================== RCS file: /cvs/gnome/evolution/calendar/gui/Makefile.am,v retrieving revision 1.301 diff -u -r1.301 Makefile.am --- calendar/gui/Makefile.am 23 Dec 2004 02:42:11 -0000 1.301 +++ calendar/gui/Makefile.am 3 Jan 2005 21:30:29 -0000 @@ -105,6 +105,8 @@ e-cal-component-preview.h \ e-cal-config.c \ e-cal-config.h \ + e-cal-event.c \ + e-cal-event.h \ e-cal-menu.c \ e-cal-menu.h \ e-cal-model-calendar.h \ Index: calendar/gui/main.c =================================================================== RCS file: /cvs/gnome/evolution/calendar/gui/main.c,v retrieving revision 1.171 diff -u -r1.171 main.c --- calendar/gui/main.c 31 Dec 2004 16:59:18 -0000 1.171 +++ calendar/gui/main.c 3 Jan 2005 21:30:29 -0000 @@ -49,6 +49,7 @@ #include "e-cal-config.h" #include "e-cal-popup.h" #include "e-cal-menu.h" +#include "e-cal-event.h" #define FACTORY_ID "OAFIID:GNOME_Evolution_Calendar_Factory:" BASE_VERSION @@ -146,6 +147,7 @@ e_plugin_hook_register_type (e_cal_popup_hook_get_type()); e_plugin_hook_register_type (e_cal_menu_hook_get_type()); e_plugin_hook_register_type (e_cal_config_hook_get_type ()); + e_plugin_hook_register_type (e_cal_event_hook_get_type ()); } Index: calendar/gui/migration.c =================================================================== RCS file: /cvs/gnome/evolution/calendar/gui/migration.c,v retrieving revision 1.32 diff -u -r1.32 migration.c --- calendar/gui/migration.c 7 Oct 2004 21:03:36 -0000 1.32 +++ calendar/gui/migration.c 3 Jan 2005 21:30:29 -0000 @@ -47,6 +47,7 @@ #include <libedataserver/e-xml-hash-utils.h> #include "calendar-config.h" #include "calendar-config-keys.h" +#include "e-cal-event.h" #include "migration.h" static e_gconf_map_t calendar_display_map[] = { @@ -700,6 +701,8 @@ { ESourceGroup *on_this_computer = NULL, *on_the_web = NULL, *contacts = NULL; ESource *personal_source = NULL; + ECalEvent *ece; + ECalEventTargetComponent *target; gboolean retval = FALSE; /* we call this unconditionally now - create_groups either @@ -833,6 +836,12 @@ } e_source_list_sync (calendar_component_peek_source_list (component), NULL); + + /* Fire off migration event */ + ece = e_cal_event_peek (); + target = e_cal_event_target_new_component (ece, calendar_component_peek (), 0); + e_event_emit ((EEvent *) ece, "component.migration", (EEventTarget *) target); + retval = TRUE; fail: if (on_this_computer)
Attachment:
e-cal-event.tar.gz
Description: application/compressed-tar