aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs/cal-backend.c
Commit message (Collapse)AuthorAgeFilesLines
* Take CalObjType as a param because its impossible to determine after aJP Rosevear2000-10-121-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-10-11 JP Rosevear <jpr@helixcode.com> * pcs/cal-backend.c (cal_backend_log_entry): Take CalObjType as a param because its impossible to determine after a delete. (cal_backend_remove_object): Calculate CalObjType and pass it to cal_backend_log_entry (cal_backend_update_object): ditto * conduits/todo/todo-conduit.c (local_record_from_comp): Kill unused variables. (add_archive_record): Don't kill the sync if this happens (update_record): Kill old function (replace_record): New function to handle replace_record signal (conduit_get_gpilot_conduit): Listen for replace record signal (add_record): Always add a new record, never replace (replace_record): Always replace an existing record * conduits/calendar/calendar-conduit.c: Same as above 2000-10-11 JP Rosevear <jpr@helixcode.com> * configure.in: Fix bonobo error message svn path=/trunk/; revision=5866
* The element is "pilot_id" not "pilotid". Update both maps (compute_pid):JP Rosevear2000-10-111-1/+6
| | | | | | | | | | | | | | | | | | | 2000-10-11 JP Rosevear <jpr@helixcode.com> * conduits/todo/todo-conduit.c (map_sax_start_element): The element is "pilot_id" not "pilotid". Update both maps (compute_pid): Utility function to set a local records pid (local_record_from_comp): Compute the pid and status here, no longer use the old cal_component pilot interfaces (free_match): Its a *local not a **local * conduits/calendar/calendar-conduit.c: same as above * conduits/todo/todo-conduit.h: Have both a uid and pid map * conduits/todo/calendar-conduit.h: same as above svn path=/trunk/; revision=5836
* Add since field to contextJP Rosevear2000-09-211-1/+1
| | | | | | | | | | | | | | | | | 2000-09-20 JP Rosevear <jpr@helixcode.com> * conduits/todo/todo-conduit.h: Add since field to context * conduits/todo/todo-conduit.c (map_set_node_timet): New utility function (map_sax_start_element): Look for the map timestamp as well (map_write): Write the map timestamp (pre_sync): Use the map time stamp when looking for changed entries * pcs/cal-backend.c (cal_backend_log_sax_start_element): Make sure we are in a valid timestamp svn path=/trunk/; revision=5527
* Make the log file name relevant to the actual calendar file, rather thanJP Rosevear2000-09-211-4/+4
| | | | | | | | | | 2000-09-20 JP Rosevear <jpr@helixcode.com> * pcs/cal-backend.c (cal_backend_log_name): Make the log file name relevant to the actual calendar file, rather than just the directory. svn path=/trunk/; revision=5526
* OopsJP Rosevear2000-09-211-1/+1
| | | | | | | | 2000-09-20 JP Rosevear <jpr@helixcode.com> * pcs/cal-backend.c (cal_backend_get_log_entries): Oops svn path=/trunk/; revision=5525
* Use a local sax handler.JP Rosevear2000-09-211-28/+5
| | | | | | | | | | | | 2000-09-20 JP Rosevear <jpr@helixcode.com> * pcs/cal-backend.c (cal_backend_get_log_entries): Use a local sax handler. * conduits/todo/todo-conduit.c (pre_sync): Use xmlSAXParseFile (map_sax_parse): Delete svn path=/trunk/; revision=5524
* Properly assign the CalObjChange type. (cal_backend_log_sax_parse): DeleteJP Rosevear2000-09-211-57/+47
| | | | | | | | | | | 2000-09-20 JP Rosevear <jpr@helixcode.com> * pcs/cal-backend.c (cal_backend_log_sax_start_element): Properly assign the CalObjChange type. (cal_backend_log_sax_parse): Delete (cal_backend_get_log_entries): Use xmlSAXUserParseFile svn path=/trunk/; revision=5523
* New utility function (cal_backend_load): use above (cal_backend_create):JP Rosevear2000-09-201-21/+35
| | | | | | | | | | | | | | | | | | | | | | | 2000-09-19 JP Rosevear <jpr@helixcode.com> * pcs/cal-backend.c (cal_backend_set_uri): New utility function (cal_backend_load): use above (cal_backend_create): use above (cal_backend_log_name): Take a uri instead of a backend param * pcs/cal-backend-file.c: Get rid of useless hash functions (cal_backend_file_load): Check to make sure path exists and is local (cal_backend_file_load): Unref the current uri if there is one (cal_backend_file_create): ditto * pcs/cal-backend.c (cal_backend_last_client_gone): Sync before shooting ourselves in the foot * pcs/cal-backend-file.c (save): Fully implement backing up the calendar before writing out the new entry. svn path=/trunk/; revision=5516
* Add some other cases where a slow sync is in order (pre_sync): Pre loadJP Rosevear2000-09-201-5/+375
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove bogus #include.Ettore Perazzoli2000-09-131-1/+1
| | | | svn path=/trunk/; revision=5379
* Added a get_objects_in_range() method. Takes in a time range and the typeFederico Mena Quintero2000-08-091-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-08-08 Federico Mena Quintero <federico@helixcode.com> * idl/evolution-calendar.idl (Cal): Added a get_objects_in_range() method. Takes in a time range and the type of component we are interested in; returns a list of UIDs. The idea is that ocurrences get computed in the client; we can have multiple recurrences in iCalendar and we cannot identify them trivially across the wire. (Cal): Removed the get_events_in_range() method. * pcs/cal-backend.c (cal_backend_free_uid_list): New function. (cal_backend_get_objects_in_range): New function. (cal_backend_get_events_in_range): Removed. * pcs/cal-backend-file.c (cal_backend_file_get_objects_in_range): Implemented new method. (cal_backend_file_get_events_in_range): Removed. * pcs/cal.c (Cal_get_events_in_range): Removed. (uncorba_obj_type): New function. (Cal_get_uids): Use uncorba_obj_type(). (Cal_get_n_objects): Likewise. (Cal_get_objects_in_range): Implemented new method. * cal-client/cal-client.c (cal_client_get_events_in_range): Removed. (cal_client_get_objects_in_range): Implemented. (corba_obj_type): New function. (cal_client_get_n_objects): Use corba_obj_type(). (cal_client_get_uids): Likewise. svn path=/trunk/; revision=4613
* New files for the iCalendar file backend.Federico Mena Quintero2000-08-031-1/+2
| | | | | | | | | | | | | | | 2000-08-02 Federico Mena Quintero <federico@helixcode.com> * pcs/cal-backend-file.[ch]: New files for the iCalendar file backend. * pcs/Makefile.am (libpcs_a_SOURCES): Added cal-backend-file.[ch]. * cal-util/cal-component.c (cal_component_set_icalcomponent): Return an operation success code for if we are passed a component of a type we don't support. svn path=/trunk/; revision=4479
* server code to service these:Seth Alves2000-06-291-0/+23
| | | | | | | | | | | | | | | | | | | | * pcs/cal.c (Cal_get_uid_by_pilot_id): (Cal_update_pilot_id): * pcs/cal-backend-imc.c (cal_backend_imc_update_pilot_id): (cal_backend_imc_get_uid_by_pilot_id): * pcs/cal-backend.c (cal_backend_get_uid_by_pilot_id): (cal_backend_update_pilot_id): server code to service these: * gui/calendar-pilot-sync.c: updated to make use of cal-client. also uses dirty bits on both sides to aid in syncing. * cal-client/cal-client.c (cal_client_get_uid_by_pilot_id): new function -- ask the cal server to return uid given an object's pilot id. (cal_client_update_pilot_id): new function -- inform the cal server of an objects pilot id and pilot dirty-flag. svn path=/trunk/; revision=3789
* Added a get_n_objects() method.Federico Mena Quintero2000-06-091-0/+19
| | | | | | | | | | | | | | | | | | | | | | 2000-06-09 Federico Mena Quintero <federico@helixcode.com> * idl/evolution-calendar.idl (Cal): Added a get_n_objects() method. * pcs/cal-backend.c (cal_backend_get_n_objects): New function. * pcs/cal-backend-imc.c (cal_backend_imc_get_n_objects): Implemented. * pcs/cal.c (Cal_get_n_objects): Implemented. * cal-client/cal-client.c (cal_client_get_uids): Free the ev. (cal_client_get_n_objects): Implemented. * cal-util/calobj.h (iCalObjectField): New enumeration to identify the fields in an iCalObject. svn path=/trunk/; revision=3486
* New function to add today's alarms for a single object.Federico Mena Quintero2000-05-121-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | 2000-05-11 Federico Mena Quintero <federico@helixcode.com> * gui/gnome-cal.c (add_alarms_for_object): New function to add today's alarms for a single object. (gnome_calendar_object_updated_cb): Update the object's alarms. * idl/evolution-calendar.idl (Cal): Added a get_alarms_for_object() method. * pcs/cal.c (Cal_get_alarms_for_object): Implemented method. * pcs/cal-backend.c (cal_backend_get_alarms_for_object): New function. * pcs/cal-backend-imc.c (cal_backend_imc_get_alarms_for_object): Implemented. * cal-client/cal-client.c (cal_client_get_alarms_for_object): New function. svn path=/trunk/; revision=3003
* Removed unused arguments. Load the initial alarms here. (load_alarms): NewFederico Mena Quintero2000-05-121-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* + * calendar/pcs/cal-backend.c (cal_backend_add_cal): Return nothingMatthew Loper2000-05-101-1/+1
| | | | | | | | | | + for a 'void' function. + * folder-browser-factory.c (control_activate): Remove "File->mail" + menuitem. + * e-shell-view-menu.c (command_run_bugbuddy): New function; allows + users to submit a bug. svn path=/trunk/; revision=2948
* CalBackendClass now is just an interface for calendar backends; this is anFederico Mena Quintero2000-05-091-895/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* for the long events pass E_DAY_VIEW_LONG_EVENT as the day. Fixes SEGV.Damon Chaplin2000-05-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-05-04 Damon Chaplin <damon@helixcode.com> * gui/e-day-view.c (e_day_view_foreach_event_with_uid): for the long events pass E_DAY_VIEW_LONG_EVENT as the day. Fixes SEGV. * gui/calendar-commands.c: when we switch views, grab the focus. * gui/gnome-cal.c (gnome_calendar_tag_calendar): (gnome_calendar_mark_gtk_calendar_day): changed this so it uses cal_client_get_events_in_range(), and doesn't load any objects. Also just return if it isn't visible. * gui/calendar-commands.c (calendar_get_events_in_range): call g_list_sort() to sort the list rather than g_list_insert_sorted() for each element. It is much more efficient. Also changed it so that the co->ev_start/end fields are copied from the CalObjInstance rather than the parameters to the function (that is right, isn't it?) Also freed the list elements, and finally the list. (calendar_iterate): changed this to use cal_client_get_events_in_range since that is more efficient than getting all the uids and then loading and parsing all the events. * pcs/cal-backend.c (save): output the '... saved' message before freeing the string! * gui/gncal-todo.c (gncal_todo_update): * gui/e-week-view.c (e_week_view_update_event): * gui/e-day-view.c (e_day_view_update_event): * gui/calendar-commands.c (calendar_get_events_in_range): (calendar_iterate): free obj_string after it is parsed. svn path=/trunk/; revision=2802
* set attendee and contact address correctly.Seth Alves2000-05-011-14/+28
| | | | | | | | | | | | * pcs/icalendar-save.c (icalcomponent_create_from_ical_object): set attendee and contact address correctly. * pcs/cal-backend.c (icalendar_calendar_load): init priv->object_hash when loading. (cal_get_type_from_filename): if file extension is .ical, consider the file an ical file. svn path=/trunk/; revision=2702
* fix memory leak (save_to_vcal): same (save): same (cal_backend_load): sameSeth Alves2000-04-281-0/+5
| | | | | | | | | * pcs/cal-backend.c (cal_backend_load): fix memory leak (save_to_vcal): same (save): same (cal_backend_load): same svn path=/trunk/; revision=2668
* Renamed from backend_destroy_cb. Now we use it for the "last_client_gone"Federico Mena Quintero2000-04-261-6/+23
| | | | | | | | | | | | | | | | | | | | | 2000-04-25 Federico Mena Quintero <federico@helixcode.com> * pcs/cal-factory.c (backend_last_client_gone_cb): Renamed from backend_destroy_cb. Now we use it for the "last_client_gone" signal from the backend. Also, unref the backend to destroy it. (add_backend): Connect to the "last_client_gone" signal of the backend. (cal_factory_get_n_backends): New function to query the number of running backends. * pcs/cal-backend.c (cal_backend_class_init): Register the new "last_client_gone" signal. It is emitted when the last Cal client goes away. It is used to notify the factory when a backend may be safely destroyed. (cal_destroy_cb): Emit the "last_client_gone" signal when the last client disconnects from the backend. svn path=/trunk/; revision=2619
* don't save on destroy.Seth Alves2000-04-261-3/+2
| | | | | | * pcs/cal-backend.c (cal_backend_destroy): don't save on destroy. svn path=/trunk/; revision=2615
* fixed code to populate the todo clistSeth Alves2000-04-201-1/+3
| | | | | | | | | | | | | | | * gui/gncal-todo.c (gncal_todo_update): fixed code to populate the todo clist * cal-client/cal-client.c (cal_client_get_uids): don't check type again CALOBJ_TYPE_ANY since it will always match. (cal_client_get_uids): same (re: CALOBJ_TYPE_ANY) * pcs/cal-backend.c (build_uids_list): same (re: CALOBJ_TYPE_ANY) * pcs/cal.c (Cal_get_uids): same (re: CALOBJ_TYPE_ANY) svn path=/trunk/; revision=2509
* don't call save from here because in all cases the caller of remove_objectSeth Alves2000-04-201-1/+1
| | | | | | | * pcs/cal-backend.c (remove_object): don't call save from here because in all cases the caller of remove_object calls save svn path=/trunk/; revision=2507
* calls gnome_calendar_open instead of checking on disk and calling load orSeth Alves2000-04-201-0/+2
| | | | | | | | | | | | * gui/calendar-commands.c (calendar_set_uri): calls gnome_calendar_open instead of checking on disk and calling load or create. * gui/gnome-cal.c (gnome_calendar_open): collapsed gnome_calendar_load and gnome_calendar_create into this function. added new type GnomeCalendarOpenMode which has the value CALENDAR_OPEN or CALENDAR_OPEN_OR_CREATE. svn path=/trunk/; revision=2506
* removed implicit save, since we don't want to save as we load from disk.Seth Alves2000-04-181-1/+2
| | | | | | | | | * pcs/cal-backend.c (add_object): removed implicit save, since we don't want to save as we load from disk. (cal_backend_update_object): added a call to save, since it isn't done by add_object now. svn path=/trunk/; revision=2471
* Renamed library from libcalutil to libcal-util, to be consistent withFederico Mena Quintero2000-04-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-04-16 Federico Mena Quintero <federico@helixcode.com> * cal-util/Makefile.am: Renamed library from libcalutil to libcal-util, to be consistent with libcal-client. Install header files in $(includedir)/evolution/cal-util. (INCLUDES): Add "cal-util" log domain for glib. (libcal_clientincludedir): The header files are now installed in $(includedir)/evolution/cal-client. * cal-util/cal-util.h: Fix includes. * cal-client/client-test.c: Fix includes. * pcs/Makefile.am: Create libpcs.a, not a shared library, because it is for internal use by Wombat only. The header files should not be installed, either. Removed all the old Tlacuache stuff. * gui/Makefile.am (EXTRA_DIST): We no longer distribute gncal.desktop. (evolution_calendar_INCLUDES): Add "calendar-gui" for the glib log domain. * gui/*.[ch]: Fix cal-util and cal-client includes. * pcs/Makefile.am (INCLUDES): Added "pcs" log domain for glib. * pcs/*.[ch]: Fix cal-util includes. svn path=/trunk/; revision=2461
* create and save an actual vcalendar instead of a list of vcal objects.Seth Alves2000-04-111-40/+56
| | | | | | | * pcs/cal-backend.c (save_to_vcal): create and save an actual vcalendar instead of a list of vcal objects. svn path=/trunk/; revision=2378
* catch cal_loaded signal on the cal client. (gnome_calendar_load_cb):Seth Alves2000-04-101-21/+114
| | | | | | | | | | | | | | | | | | | * gui/gnome-cal.c (gnome_calendar_load): catch cal_loaded signal on the cal client. (gnome_calendar_load_cb): callback for cal_loaded signal. moved gnome_calendar_update_all from gnome_calendar_load to here. * gui/calendar-commands.c: minor cleanups * pcs/cal-backend.c (save_to_vcal): copied code from gnome-pim to write vcal to a file (save): filled it with more gnome-pim code (add_object): call save () after changing (remove_object): same (cal_backend_create): same (cal_backend_remove_object): same svn path=/trunk/; revision=2352
* Use ical_object_to_string().Federico Mena Quintero2000-03-281-71/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-03-27 Federico Mena Quintero <federico@helixcode.com> * pcs/cal-backend.c (cal_backend_get_object): Use ical_object_to_string(). * cal-util/calobj.c (ical_object_to_string): Moved over from pcs/cal-backend.c (was string_from_ical_object). (get_calendar_base_vobject): Likewise, moved over from pcs/cal-backend.c. * cal-util/cal-util.c: Removed string_to_ical_object(); the correct function is in calobj.[ch], called ical_object_find_in_string(). Removed ical_object_to_string, since we now implement it in calobj.c. * cal-util/calobj.c: Removed ical_object_new_from_string(); see above. * idl/evolution-calendar.idl (CalObjInstance): Calendar object instances now contain only the UID for the object, not the whole string representation of the object. This allows clients to implement caching of objects if they wish. * pcs/cal.c (Cal_get_events_in_range): Likewise. * pcs/cal-backend.c (build_event_list): Likewise. * cal-client/cal-client.c (cal_client_get_events_in_range): Likewise. * cal-util/cal-util.h (CalObjInstance): Likewise. * cal-util/cal-util.c (cal_obj_instance_list_free): Likewise. (cal_obj_uid_list_free): Assert that the UIDs in the list are not NULL. * pcs/tlacuache.gnorba (repo_id): The calendar factory also supports the Unknown interface. svn path=/trunk/; revision=2211
* replaced "Calendar *cal" with "CalClient *calc" in the GnomeCalendarSeth Alves2000-03-091-1/+1
| | | | | | | | | | | | | | | * gui/gnome-cal.h: replaced "Calendar *cal" with "CalClient *calc" in the GnomeCalendar struct. * gui/*.c: tracked change from Calendar * to CalClient * gui/main.c: moved alarm_defaults from here to cal-util/calobj.c (calendar_get_events_in_range): pulled this out of calendar.c and fixed it up to use cal-client stuff. i'm not sure where to put it yet. * gui/main.c (calendar_iterate): pulled this one out of calendar.c also svn path=/trunk/; revision=2090
* moved CalendarFormat type def hereSeth Alves2000-02-181-7/+129
| | | | | | | | | | | | | | * cal-backend.h: moved CalendarFormat type def here * cal-backend.c (cal_backend_load): if extension suggests an ical file, attempt to load an iCal file. (cal_get_type_from_filename): returns CAL_ICAL if file extension is 'ics' or 'ifb', else returns CAL_VCAL (icalendar_calendar_load): moved this here from icalendar.c because it needs to call the static function add_object. svn path=/trunk/; revision=1831
* Implemented.Federico Mena Quintero2000-02-171-6/+46
| | | | | | | | | | | | | | | | 2000-02-17 Federico Mena Quintero <federico@helixcode.com> * cal-client.c (cal_client_remove_object): Implemented. * cal.c (cal_notify_remove): Implemented. (Cal_remove_object): Implemented. (cal_get_epv): Fill in the remove_object field in the epv. * cal-backend.c (cal_backend_remove_object): Implemented. (notify_remove): New function to notify clients that an object was removed. svn path=/trunk/; revision=1821
* Implemented.Federico Mena Quintero2000-02-121-1/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-02-11 Federico Mena Quintero <federico@helixcode.com> * cal-client.c (cal_client_update_object): Implemented. * cal.c (cal_notify_update): New function to notify the listener about an updated object. (Cal_update_object): Implemented. (Cal_get_uids): set_release() the sequence to TRUE. (Cal_get_events_in_range): Likewise. * cal-backend.c (remove_object): New function to remove objects from a calendar backend. (cal_backend_update_object): New public function to update an object and notify clients about it. * evolution-calendar.idl (Cal): Added update_object() and delete_object() methods. (Listener): Removed the obj_changed method and renamed obj_added to obj_updated. We now only have updated and removed notifiers. * cal-listener.[ch]: Removed the "changed" notification code. Changed the "added" notification code to the "updated" notification. * cal-client.c: Likewise. * tlacuache.c (create_cal_factory): Connect to "destroy" on the factory and exit the main loop when the factory is destroyed. * cal-factory.c (backend_destroy_cb): New callback used when a backend is destroyed. Removes the backend from the factory's hash table and unrefs the factory if all backends go away. (add_calendar_client): Free the environment. * cal.c (cal_new): Use bonobo_object_unref() if we fail to initialize. * cal-listener.c (cal_listener_new): Likewise. * layout.c (layout_events): Plug li.partition memory leak. svn path=/trunk/; revision=1742
* Connect to the Cal's destroy signal. (cal_backend_remove_cal): KilledFederico Mena Quintero2000-02-111-38/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-02-10 Federico Mena Quintero <federico@helixcode.com> * 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 <federico@helixcode.com> * 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
* Added get_uids() method to get a list of UIDs based on object types.Federico Mena Quintero2000-02-091-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-02-08 Federico Mena Quintero <federico@helixcode.com> * evolution-calendar.idl (Cal): Added get_uids() method to get a list of UIDs based on object types. * cal-backend.c (cal_backend_get_uids): Implemented get_uids() in the backend. * cal.c (Cal_get_uids): Implemented get_uids() method. * cal-client.c (cal_client_get_uids): Implemented client-side function. * cal-util.c (cal_obj_instance_list_free): Doh. Free the list, not the last link. (cal_obj_uid_list_free): New function to free a list of UIDs. * GnomeCal.idl (Repository): Removed unused method get_object_by_id_list(). This is just for cleanup purposes and to remind me exactly of what needs to be moved over to evolution-calendar.idl. (Repository): Removed unused get_objects() method. * corba-cal.c (init_calendar_repo_class): Removed the unused get_objects method. * calobj.h (CalObjFindStatus): New status value enumeration for the find function. * calobj.c (ical_object_find_in_string): New function to parse a complete calendar and find a calendar object in it. This should be used instead ical_object_new_from_string() in the future. * evolution-calendar.idl (CalObjInstance): Added an uid field. Now the idea is that whenever calendar object strings are passed around, their UIDs are passed along with them so that the actual object can be pulled from the whole VCAL object using its UID to identify it. * cal-util.h (CalObjInstance): Added uid field. * cal-util.c (cal_obj_instance_list_free): Free the UIDs. * cal-backend.c (build_event_list): Store the object's UID in the instance structure. * cal.c (Cal_get_events_in_range): Copy the UID field to the CORBA structure. * cal-client.c (cal_client_get_events_in_range): Copy the UID field from the CORBA structure. * main.c (gnome_cal_file_menu): Removed unfinished html-month stuff. * Makefile.am (gnomecal_SOURCES): Removed html-month.c. * gnome-cal.c: #include "alarm.h" (mail_notify): Made static. * alarm.h: #include "calobj.h" * corba-cal-factory.h (init_corba_server): Fixed prototype. * quick-view.c (create_items_for_event): Made static. * gncal-todo.c (column_resized): Made static. * layout.c (find_index): Made static. svn path=/trunk/; revision=1699
* New struct to wrap instances of calendar objects for recurrencies andFederico Mena Quintero2000-02-081-10/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-02-08 Federico Mena Quintero <federico@helixcode.com> * evolution-calendar.idl (CalObjInstance): New struct to wrap instances of calendar objects for recurrencies and alarms. (Cal::get_events_in_range): New method to get ocurring and recurring events by time range. * cal-backend.c (cal_backend_get_events_in_range): New function to get a list of event instances in a time range. (string_from_ical_object): New internal function. (cal_backend_get_object): Use string_from_ical_object() instead of doing everything ourselves. (cal_backend_get_events_in_range): New function to get a list of the events that occur or recur in a specified time range. * cal-client.c (cal_client_get_events_in_range): Implemented client-side function. * cal-util.h: * cal-util.c: New files with utilities and types common to the client and server parts. (CalObjInstance): New structure to hold an instance of an actual occurrence, recurrence, or alarm trigger of a calendar object. (cal_obj_instance_list_free): New function to free a list of calendar object instances. * cal.c (Cal_get_events_in_range): Implemented new method. * corba-cal.c (cal_repo_get_updated_objects): Free `str' with free(), not g_free(), since calendar_get_as_vcal_string() uses writeMemVObject(), which uses realloc(). Fixed in gnome-pim as well. svn path=/trunk/; revision=1693
* New function to create the base VObject for a calendar.Federico Mena Quintero2000-02-041-1/+45
| | | | | | | | | | | | | | | | | | | | | | | | | 2000-02-04 Federico Mena Quintero <federico@helixcode.com> * cal-backend.c (get_calendar_base_vobject): New function to create the base VObject for a calendar. (cal_backend_get_object): Create the base calendar and add the sought object to it, then stringify it. * evolution-calendar.idl (Listener::obj_added Listener::obj_changed): Now these pass in just the UIDs, not the complete objects. * cal-listener.c (Listener_obj_added): Changed to pass in the uid, not the object. (Listener_obj_changed): Likewise. * cal-client.h (CalClientClass): Made the obj_added and obj_changed signals take in the UIDs, not the full objects. * cal-client.c (obj_added_cb): Likewise. (obj_changed_cb): Likewise. svn path=/trunk/; revision=1666
* Sync to laptop - FedericoArturo Espinosa2000-02-031-24/+64
| | | | svn path=/trunk/; revision=1664
* Added the get_object() method.Federico Mena Quintero2000-02-021-0/+27
| | | | | | | | | | | | | | | | | 2000-02-03 Federico Mena Quintero <federico@helixcode.com> * evolution-calendar.idl (Cal): Added the get_object() method. * cal-client.c (cal_client_get_object): New function to get a calendar object by its UID. * cal.c (Cal_get_object): Implemented. * cal-backend.c (cal_backend_get_object): New unfinished backend function. We need some reorganizing of how the calendar objects are stored. svn path=/trunk/; revision=1663
* Changed the namespace from GNOME::Calendar to Evolution::Calendar.Federico Mena Quintero2000-01-291-1/+1
| | | | | | | | | | | | | | | | | 2000-01-30 Federico Mena Quintero <federico@helixcode.com> * evolution-calendar.idl: Changed the namespace from GNOME::Calendar to Evolution::Calendar. (Listener::LoadStatus): Fixed SUCESSS -> SUCCESS typo. And I never noticed it in the implementation. Ain't M-/ grand? * Makefile.am: Changed ocurrences of gnome-calendar.idl to evolution-calendar.idl. * *.[ch]: Changed GNOME_Calendar_foo identifiers to Evolution_Calendar_foo. svn path=/trunk/; revision=1652
* Added the gnome-pilot and capplet checks; they will likely be reworked forFederico Mena Quintero2000-01-251-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-01-24 Federico Mena Quintero <federico@helixcode.com> * configure.in: Added the gnome-pilot and capplet checks; they will likely be reworked for the Evolution framework, but for now the calendar/ directory needs them. * configure.in: Added checks for gnome-vfs. 2000-01-24 Federico Mena Quintero <federico@helixcode.com> * tlacuache.c: New main module for the Tlacuache personal calendar server. * tlacuache.gnorba: New gnorba file for Tlacuache, the GNOME personal calendar server. * Makefile.am: Added the stuff necessary to build Tlacuache. * cal.c (Cal_get_uri): Convert the URI to a string before returning it. * cal-factory.c (CalFactory_create): Doh, this function is void. * job.c (job_add): Use g_idle_add(), not gtk_idle_add(). svn path=/trunk/; revision=1623
* New function to remove a calendar client interface object from a backend.Federico Mena Quintero2000-01-241-1/+48
| | | | | | | | | | | | | | | | | | | | | 2000-01-24 Federico Mena Quintero <federico@helixcode.com> * cal-backend.c (cal_backend_remove_cal): New function to remove a calendar client interface object from a backend. (cal_backend_load): Convert the URI to string and use Parse_MIME_FromFileName(). The conversion is not very smart, though. * cal-factory.c (load_backend): Moved most of the error handling upstream to load_fn(). (load_fn): Handle failure in case the backend could not be loaded. (cal_factory_destroy): Free the backends and the backend hash table. (add_calendar_client): Implemented. We create a Cal client interface object and attach it to the backend, and we notify the listener. svn path=/trunk/; revision=1618
* Take in a GnomeVFSURI, not a string.Federico Mena Quintero2000-01-221-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | 2000-01-22 Federico Mena Quintero <federico@helixcode.com> * cal-backend.c (cal_backend_load): Take in a GnomeVFSURI, not a string. * cal-listener.c (Listener_cal_loaded): Pass the load status to the signal. (cal_listener_destroy): Better error checking. (cal_listener_new): Better error checking. * cal-listener.h (CalListenerLoadStatus): New enum for the load status of a calendar. (CalListenerClass): Added the status argument to the cal_loaded signal. * gnome-calendar.idl (cal_loaded): Added a load status code. * cal-backend.h (CalBackendLoadStatus): Renamed from CalBackendLoadResult. svn path=/trunk/; revision=1607
* Moved the calendar backend here. This is the actual calendar-handlingFederico Mena Quintero2000-01-191-0/+344
2000-01-18 Federico Mena Quintero <federico@helixcode.com> * cal-backend.c cal-backend.h: Moved the calendar backend here. This is the actual calendar-handling object. (load_from_vobject): Moved over from calendar.c. Modified to use a CalBackend instead of the old Calendar structure. (add_object): Likewise. * cal.c: Now the Cal object is just a calendar client interface object; we use it as a "viewport" onto a CalBackend. This also lets us do correct resource management. * cal-common.h: New file with common forward declarations; we can't have circular dependencies between headers. 2000-01-18 Federico Mena Quintero <federico@helixcode.com> * cal-factory.c (cal_factory_load): Queue a load job. (load_fn): Load job handler. Lookup the calendar by URI, load it if it is not loaded, or just report it to the new listener if it is. * job.c job.h: New files with a simple job queue manager. * gnome-calendar.idl (Listener::cal_loaded): Do not return the whole calendar object string. The client will be able to query the calendar for the events it needs. * cal-listener.c (Listener_cal_loaded): Ref the calendar GNOME object. We unref it when the listener is destroyed. 2000-01-17 Federico Mena Quintero <federico@helixcode.com> The files from the gncal directory of the gnome-pim module on CVS were moved here, to evolution/calendar, in preparation for the Evolution work. The calendar is being split into a model/view architecture. The model is a personal calendar server (PAS): it provides storage, notification, and event generation; the views/controllers are the calendar user agents and things like Pilot synchronizers. svn path=/trunk/; revision=1591