From d8fbc4fc0c01d174f04e8f2370131a5240764f4b Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Fri, 11 Feb 2000 11:08:08 +0000 Subject: Connect to the Cal's destroy signal. (cal_backend_remove_cal): Killed 2000-02-10 Federico Mena Quintero * cal-backend.c (cal_backend_add_cal): Connect to the Cal's destroy signal. (cal_backend_remove_cal): Killed function now that removal of Cal objects is done in their destroy callback. (cal_destroy_cb): New callback to remove a Cal from the backend's list of clients. Also, the backend destroys itself when there are no more clients connected to it. (save): New placeholder function to save a backend. (destroy): New function to destroy a backend's data. (cal_backend_destroy): Save the calendar and destroy it. * cal.c (cal_destroy): Reset the priv->backend to NULL. * cal-factory.c (add_calendar_client): There is no need to call cal_backend_remove_cal(); we can now just destroy the Cal object. (create_fn): Make sure we always unref the URI. (load_fn): Move the URI unref to the end of the function for safety. * cal-factory.c (add_calendar_client): Unref the Cal only if notification of the listener was unsuccessful. Otherwise, the calendar user agent (Listener side) keeps the reference. * tl-test.c (list_uids): Free the calobj. * cal-client.c (cal_loaded_cb): Use bonobo_object_unref() to get rid of the listener. (load_or_create): Likewise. (destroy_factory): New function to get rid of the factory. (destroy_listener): New function to get rid of the listener. (destroy_cal): New function to get rid of the calendar client interface object. (cal_client_destroy): Free all resources. (cal_client_get_object): CORBA_free() the calobj string. Boy, I love memprof. * cal-listener.c (cal_listener_destroy): Reset the priv->cal to CORBA_OBJECT_NIL. * cal-backend.c (cal_backend_remove_cal): Do not unref the Cal, since the calendar user agent owns it. (cal_backend_add_cal): Do not ref the Cal, since the calendar user agent owns it. * cal-factory.c (add_calendar_client): Use bonobo_object_unref() to get rid of the calendar client interface object. * calobj.c (ical_object_create_from_vobject): Duplicate the default "PUBLIC" string. 2000-02-09 Federico Mena Quintero * cal-factory.c (cal_factory_load): Added documentation comment. (load_fn): Do not print a message if the backend could not be loaded due to a non-fatal error. (queue_load_create_job): Moved the stuff from cal_factory_load() to here. Now this function serves to queue load or create requests. (cal_factory_load): Use queue_load_create_job(). (cal_factory_create): Implemented; use queue_load_create_job(). (create_fn): New job handler for creating new calendars. (create_backend): New function to create a new backend with a new calendar. (add_backend): New helper function to add backends to the factory's hash table. (load_backend): Use add_backend() instead of adding the backend by ourselves. * cal-client.c (load_or_create): Moved the functionality from cal_client_load_calendar() to here, and added an option to create a new calendar instead of loading an existing one. (cal_client_load_calendar): Use load_or_create(). (cal_client_create_calendar): Implemented. * cal-backend.c (cal_backend_create): Implemented. * evolution-calendar.idl (LoadStatus): Added an IN_USE error for create requests. * cal-listener.h (CalListenerLoadStatus): Added CAL_LISTENER_LOAD_IN_USE. * cal-listener.c (Listener_cal_loaded): Convert the IN_USE error. * cal-client.h (CalClientLoadStatus): Added CAL_CLIENT_LOAD_IN_USE. * cal-client.c (cal_loaded_cb): Handle CAL_LISTENER_LOAD_IN_USE. * tl-test.c: New test program for the calendar client side; it also exercises the server side by sending commands to it. * Makefile.am: Added the tl-test program. * tlacuache.gnorba: Updated. * tlacuache.c (create_cal_factory): Use the right GOAD id. * cal-client.c (cal_client_construct): Use the right GOAD id. svn path=/trunk/; revision=1732 --- calendar/gui/Makefile.am | 28 ++++++++-- calendar/gui/test2.vcf | 133 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 157 insertions(+), 4 deletions(-) create mode 100644 calendar/gui/test2.vcf (limited to 'calendar/gui') diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am index 23bc461141..8fab42d57c 100644 --- a/calendar/gui/Makefile.am +++ b/calendar/gui/Makefile.am @@ -42,17 +42,17 @@ corba-cal.h \ corba-cal-factory.c \ corba-cal-factory.h: GnomeCal.h -GNOME_CALENDAR_CORBA_GENERATED = \ +EVOLUTION_CALENDAR_CORBA_GENERATED = \ evolution-calendar.h \ evolution-calendar-common.c \ evolution-calendar-skels.c \ evolution-calendar-stubs.c -$(GNOME_CALENDAR_CORBA_GENERATED): evolution-calendar.idl +$(EVOLUTION_CALENDAR_CORBA_GENERATED): evolution-calendar.idl orbit-idl -I`$(GNOME_CONFIG) --datadir`/idl $(srcdir)/evolution-calendar.idl gnomecal_SOURCES = \ - $(GNOME_CALENDAR_CORBA_GENERATED) \ + $(EVOLUTION_CALENDAR_CORBA_GENERATED) \ GnomeCal-common.c \ GnomeCal-skels.c \ GnomeCal.h \ @@ -125,7 +125,7 @@ calendar_pilot_sync_SOURCES = \ timeutil.h tlacuache_SOURCES = \ - $(GNOME_CALENDAR_CORBA_GENERATED) \ + $(EVOLUTION_CALENDAR_CORBA_GENERATED) \ alarm.c \ alarm.h \ cal.c \ @@ -162,6 +162,26 @@ calendar_pilot_sync_LDADD = \ $(PISOCK_LIBDIR) $(PISOCK_LIBS) \ $(LINK_FLAGS) +noinst_PROGRAMS = tl-test + +tl_test_SOURCES = \ + $(EVOLUTION_CALENDAR_CORBA_GENERATED) \ + cal-client.c \ + cal-client.h \ + cal-listener.c \ + cal-listener.h \ + cal-util.c \ + cal-util.h \ + tl-test.c + +tl_test_INCLUDES = \ + $(INCLUDES) \ + -DG_LOG_DOMAIN=\"tl-test\" + +tl_test_LDADD = \ + $(BONOBO_VFS_GNOME_LIBS) \ + ../libversit/libversit.la + if HAVE_GNOME_PILOT #calendar_conduit calendar_conduitsdir=$(libdir)/gnome-pilot/conduits diff --git a/calendar/gui/test2.vcf b/calendar/gui/test2.vcf new file mode 100644 index 0000000000..6446507989 --- /dev/null +++ b/calendar/gui/test2.vcf @@ -0,0 +1,133 @@ +BEGIN:VCALENDAR +PRODID:-//GNOME//NONSGML GnomeCalendar//EN +TZ:MST +VERSION:0.13 +BEGIN:VEVENT +UID:KOrganizer - 8469308861 +SEQUENCE:1 +DTSTART:19980601T150000 +DTEND:19980601T150000 +DCREATED:19980402T023558 +LAST-MODIFIED:19980402T023558 +SUMMARY:Cada dos dias de 06/01 al 07/01 +STATUS:NEEDS ACTION +CLASS:PUBLIC +PRIORITY:0 +TRANSP:0 +RELATED-TO:0 +RRULE:D2 19980701T140000 +END:VEVENT + +BEGIN:VEVENT +UID:KOrganizer - 8469308862 +SEQUENCE:1 +DTSTART:19980501T140000 +DTEND:19980501T140000 +DCREATED:19980402T023558 +LAST-MODIFIED:19980402T023558 +SUMMARY:5 dias. +STATUS:NEEDS ACTION +CLASS:PUBLIC +PRIORITY:0 +TRANSP:0 +RELATED-TO:0 +RRULE:D1 #5 +END:VEVENT + +BEGIN:VEVENT +UID:KOrganizer - 8469308863 +SEQUENCE:1 +DTSTART:19980501T140000 +DTEND:19980501T150000 +DCREATED:19980402T023558 +LAST-MODIFIED:19980429T004635 +SUMMARY:Diariamente de 05/01 al 06/01 +STATUS:NEEDS ACTION +CLASS:PRIVATE +PRIORITY:0 +TRANSP:0 +RELATED-TO:0 +RRULE:D1 19980601T000000 +END:VEVENT + +BEGIN:VEVENT +UID:KOrganizer - 18042893834 +SEQUENCE:1 +DTSTART:19980415T010000 +DTEND:19980415T013000 +DCREATED:19980402T023552 +LAST-MODIFIED:19980330T225948 +SUMMARY:Diario durante 5 dias +STATUS:NEEDS ACTION +CLASS:PUBLIC +PRIORITY:0 +TRANSP:0 +RELATED-TO:0 +RRULE:D1 #5 +END:VEVENT + +BEGIN:VEVENT +UID:KOrganizer - 18042893835 +SEQUENCE:1 +DTSTART:19980415T010000 +DTEND:19980415T013000 +DCREATED:19980402T023552 +LAST-MODIFIED:19980330T225948 +SUMMARY:Diario durante 5 dias +STATUS:NEEDS ACTION +CLASS:PUBLIC +PRIORITY:0 +TRANSP:0 +RELATED-TO:0 +RRULE:D1 #5 +END:VEVENT + +BEGIN:VTODO +UID:KOrganizer - 8469308866 +SEQUENCE:1 +DTSTART:19980415T140000 +DUE:19691231T180000 +DCREATED:19980402T023558 +LAST-MODIFIED:19980402T023558 +SUMMARY:Normal +STATUS:NEEDS ACTION +CLASS:PUBLIC +PRIORITY:0 +TRANSP:0 +RELATED-TO:0 +END:VTODO + +BEGIN:VTODO +UID:KOrganizer - 18042893837 +SEQUENCE:1 +DTSTART:19980415T120000 +DUE:19691231T180000 +DCREATED:19980402T023552 +LAST-MODIFIED:19980330T225948 +SUMMARY:Semanal -- 4 semanas +STATUS:NEEDS ACTION +CLASS:PUBLIC +PRIORITY:0 +TRANSP:0 +RELATED-TO:0 +RRULE:W1 WE #4 +END:VTODO + +BEGIN:VTODO +UID:KOrganizer - 18042893838 +SEQUENCE:1 +DTSTART:19980415T003000 +DUE:19691231T180000 +DCREATED:19980402T023552 +LAST-MODIFIED:19980330T225948 +SUMMARY:Semana: Mi, Ju, Vi, Dom (10 veces) +STATUS:NEEDS ACTION +CLASS:PUBLIC +PRIORITY:0 +TRANSP:0 +RELATED-TO:0 +RRULE:W1 SU WE TH FR #10 +END:VTODO + +END:VCALENDAR + -- cgit