aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs/cal-backend-imc.h
Commit message (Collapse)AuthorAgeFilesLines
* Add some other cases where a slow sync is in order (pre_sync): Pre loadJP Rosevear2000-09-201-61/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-09-19 JP Rosevear <jpr@helixcode.com> * conduits/todo/todo-conduit.c (check_for_slow_setting): Add some other cases where a slow sync is in order (pre_sync): Pre load the uids, the map and the add/mod/del lists (match_record): Use the map hash to match records (iterate): Iterate using the pre-loaded uid list (iterate_specific): Iterate using the add/mod/del lists (purge): Delete all entries in the del list (set_status): Set status by adding to an appropriate list (set_pilot_id): Set pilot_id by updating map hash * conduits/todo/todo-conduit.h: Add lists for added, modified and deleted objects * conduits/todo/todo-conduit.c (map_name): Get the pilot_id->uid map file name (map_sax_start_element): SAX handler to extract a pilot_id->uid mapping (map_sax_parse): Parse the given file and build a pilot_id->uid hash (map_write_foreach): Write out individual mapping elements (map_write): Write out the pilot_id->uid mapping (start_calendar_server_cb): Rename from gnome_calendar_load_cb * conduits/todo/todo-conduit-config.h: Rename pilotID to pilot_id * conduits/todo/e-todo.conduit.in: A little renaming * conduits/todo/Makefile.am: Fix build slightly * pcs/cal.c (build_change_seq): Build a corba sequence out of a list of CalObjChanges (Cal_get_objects_in_range): Implement new corba function * pcs/cal-backend.c (cal_backend_init): Intiliaze to NULL (cal_backend_load): Track the uri so we can write the log file to the same place (cal_backend_log_name): Figure out the log filename/path based on the calendar uri (cal_backend_set_node_timet): Set an xml node property value from a time_t (cal_backend_log_entry): Adds a log entry to list waiting to be written out (cal_backend_log_sync): Syncs the log entries to disk (cal_backend_log_sax_start_element): SAX callback for reading in log entries (cal_backend_log_sax_end_element): ditto (cal_backend_log_sax_parse): Main SAX parser call to parse the log file looking for particular log entries and creating a CalObjChange hash with the last change for each object (cal_backend_get_log_entries): Returns a hash of objects of a given type changed since the given time (cal_backend_update_object): Add appropriate log entries (cal_backend_remove_object): ditto (cal_backend_get_changed_uids): Implement new idl interface call (cal_backend_foreach_changed): Convert CalObjChange hash into a list * pcs/cal-backend-imc.[hc]: Remove crufty files * pcs/cal-backend-file.c (cal_backend_file_get_type_by_uid): New function that returns the CalObjType for a uid. * cal-client/cal-client.h: Update prototypes. * cal-client/cal-client.c (build_change_list): Build a list of CalObjChange items from a corba sequence. (cal_client_get_changed_uids): New accessor method for the similarly named addition to the idl file. * cal-util/cal-util.h: Update prototypes and add CalObjChangeType enum. * cal-util/cal-util.c (cal_obj_change_list_free): New utility method to free a list of CalObjChange objects. * idl/evolution-calendar.idl: Add get_changed_uids method and associated types. svn path=/trunk/; revision=5512
* Removed unused arguments. Load the initial alarms here. (load_alarms): NewFederico Mena Quintero2000-05-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-05-11 Federico Mena Quintero <federico@helixcode.com> * gui/gnome-cal.c (gnome_calendar_update_all): Removed unused arguments. Load the initial alarms here. (load_alarms): New function to load a day's worth of alarms. (gnome_calendar_class_init): Eeeek! This was taking in an incorrect argument type. (gnome_calendar_init): Now the calendar keeps a hash table of UIDs->queued alarms. Create the hash table here. (gnome_calendar_destroy): Destroy the alarms hash table. (gnome_calendar_object_updated_cb): Remove the alarms for the object and regenerate them. (gnome_calendar_object_removed_cb): Remove the alarms for the object. * gui/alarm.c (alarm_add): Do not take in a CalendarAlarm, just the trigger time, the callback and the closure data. Return an opaque identifier for the alarm so that it can be removed by the client code if needed. Use the queue_alarm() helper function. (queue_alarm): Helper function to actually queue the alarm and set up the itimer. Deal with a nonzero return value from setitimer(). (alarm_remove): New function to remove an alarm based on its ID. (pop_alarm): New helper function; pops the first alarm of the queue and resets the timer as appropriate. (alarm_ready): Simplified a lot by using pop_alarm(). * idl/evolution-calendar.idl (Cal): Added get_alarms_in_range(). * pcs/cal.c (build_instance_seq): New function to build a CORBA sequence from the internal list of instances. (Cal_get_events_in_range): Use build_instance_seq(). (Cal_get_alarms_in_range): Implemented new method. * pcs/cal-backend.c (cal_backend_get_alarms_in_range): New function with the get_alarms_in_range() engine. * pcs/cal-backend-imc.c (cal_backend_imc_get_alarms_in_range): Implemented the get_alarms_in_range() method. * cal-client/cal-client.c (cal_client_get_alarms_in_range): New client-side function for getting the alarms. (build_instance_list): New helper function to build the CalObjInstance list from the CORBA sequence. (cal_client_get_events_in_range): Use build_instance_list(). * gui/calendar-commands.h: #include <cal-util/calobj.h>. #include "gnome-cal.h". * gui/e-week-view.c: #include "calendar-commands.h" instead of main.h; the latter is an obsolete file and will be killed. * gui/evolution-calendar-control.c (main): Call init_bonobo() before anything else. We need the GTK+ object system initialized. * gui/Makefile.am (evolution_calendar_SOURCES): Do not use main.h. * cal-util/cal-util.c (cal_alarm_instance_list_free): New function. svn path=/trunk/; revision=2987
* CalBackendClass now is just an interface for calendar backends; this is anFederico Mena Quintero2000-05-091-0/+60
2000-05-08 Federico Mena Quintero <federico@helixcode.com> * pcs/cal-backend.h (CalBackendClass): CalBackendClass now is just an interface for calendar backends; this is an abstract class. Put in the vtable for the backend methods. * pcs/cal-backend.c (cal_backend_new): Removed function, since CalBackend is not just an abstract class. Removed implementation-specific functions and made public functions call the virtual methods instead. * pcs/cal-backend-imc.[ch]: New files with the CalBackendIMC implementation; this implements a backend for iCalendar and vCalendar files. Moved the implementation-specific stuff from cal-backend.[ch] to here. * pcs/cal-backend-imc.c (CalendarFormat): Moved enumeration to here. Added a CAL_UNKNOWN value for when the backend is not loaded yet. (cal_backend_imc_init): Initialize priv->format as CAL_UNKNOWN. (save_to_vcal): Use the same VCProdIdProp value as in cal-util/calobj.c. Use "1.0" as the VCVersionProp as per the vCalendar spec. (ensure_uid): Return nothing, since the result value need not be used anymore. (add_object): Since we mark the calendar as dirty anyways, we do not need to check the result value of ensure_uid() anymore. (remove_object): Asssert that we know how to handle the object's type. We do this in add_object() anyways. * pcs/Makefile.am (libpcs_a_SOURCES): Added cal-backend-imc.[ch]. * gui/gnome-cal.c: Replaced debugging printf()s with g_message() so that we can see the line number where they occur. * gui/gnome-cal.c (gnome_calendar_load_cb): Sort of handle the LOAD_METHOD_NOT_SUPPORTED result code, and added a default for the switch. * cal-client/cal-listener.h (CalListenerLoadStatus): Removed enumeration; it is stupid to translate all values for the CalClient when it is going to translate them again. (CalListenerClass::cal_loaded): This signal now passes the LoadStatus directly from the CORBA side. * cal-client/cal-listener.c (Listener_cal_loaded): Do not translate the status value. * cal-client/cal-client.h (CalClientLoadStatus): Added the CAL_CLIENT_LOAD_METHOD_NOT_SUPPORTED error code. * cal-client/cal-client.c (cal_loaded_cb): Translate the CORBA version of the LoadStatus result code. * pcs/cal-factory.c (CalFactoryPrivate): New methods field for the hash table from method strings to the GtkTypes for backend class types. (cal_factory_init): Create the priv->methods hash table. (cal_factory_destroy): Free the priv->methods hash table. (cal_factory_register_method): New function to register a backend class for a particular URI method. (launch_backend_for_uri): New function to launch a backend for a particular URI's method. (load_backend): Use launch_backend_for_uri(). Move the error notification code from load_fn() to here. (create_backend): Use launch_backend_for_uri(). Move the error notification code form create_fn() to here; it is #ifdefed out since currently cal_backend_create() does not have any error reporting capabilities. * idl/evolution-calendar.idl (Listener::LoadStatus): Added a PROTOCOL_NOT_SUPPORTED error code. * pcs/cal-factory.c (cal_factory_load cal_factory_create): Removed functions, since they were supposed to be internal only. (CalFactory_load): Call queue_load_create_job() directly. (CalFactory_create): Likewise. svn path=/trunk/; revision=2921