aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs/cal.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2001-09-19 04:16:39 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2001-09-19 04:16:39 +0800
commit2b78b5294a6a047a971446595c9e7f5f32f583a2 (patch)
tree6b74cd7376bb1ab8024871a5e2b059d669ebf6d8 /calendar/pcs/cal.c
parent3e079da9b69b8f5c47c79bcbb269ac17cc094c6e (diff)
downloadgsoc2013-evolution-2b78b5294a6a047a971446595c9e7f5f32f583a2.tar.gz
gsoc2013-evolution-2b78b5294a6a047a971446595c9e7f5f32f583a2.tar.zst
gsoc2013-evolution-2b78b5294a6a047a971446595c9e7f5f32f583a2.zip
new class for managing multiple calendars, with an API very similar to the
2001-09-18 Rodrigo Moya <rodrigo@ximian.com> * cal-client/cal-client-multi.[ch]: new class for managing multiple calendars, with an API very similar to the CalClient one, for ease of transition from one to the other * gui/component-factory.c (xfer_folder, remove_folder, create_folder): reworked to be able to manage folders for any calendar backend, and not only the file: one 2001-09-18 Rodrigo Moya <rodrigo@ximian.com> * idl/evolution-calendar.idl: changed signature for the getFreeBusy method, to return a sequence of CalObj's, and added sequence of users as a new parameter to that method * cal-client/cal-client.c (cal_client_get_free_busy): adapted to new IDL method signature, by adding a new "GList *users" parameter, for callers to be able to specify a list of users * pcs/cal-backend.[ch] (cal_backend_get_free_busy): * pcs/cal-backend-file.c (cal_backend_file_get_free_busy): add the "GList *users" parameter. In cal_backend_file_get_free_busy, call lookup_component to get the CalComponent for each uid, instead of calling cal_backend_get_object, which meant converting the component to a string and then parsing it again. * cal-client/client-test.c (cal_opened_cb): * gui/e-itip-control.c (send_freebusy): * gui/calendar-commands.c (publish_freebusy_cmd): adapted to new getFreeBusy method signature svn path=/trunk/; revision=12951
Diffstat (limited to 'calendar/pcs/cal.c')
-rw-r--r--calendar/pcs/cal.c55
1 files changed, 42 insertions, 13 deletions
diff --git a/calendar/pcs/cal.c b/calendar/pcs/cal.c
index 213ad35c31..9532e8265a 100644
--- a/calendar/pcs/cal.c
+++ b/calendar/pcs/cal.c
@@ -233,16 +233,19 @@ impl_Cal_get_objects_in_range (PortableServer_Servant servant,
}
/* Cal::get_free_busy method */
-static GNOME_Evolution_Calendar_CalObj
+static GNOME_Evolution_Calendar_CalObjSeq *
impl_Cal_get_free_busy (PortableServer_Servant servant,
- GNOME_Evolution_Calendar_Time_t start,
- GNOME_Evolution_Calendar_Time_t end,
+ const GNOME_Evolution_Calendar_UserList *user_list,
+ const GNOME_Evolution_Calendar_Time_t start,
+ const GNOME_Evolution_Calendar_Time_t end,
CORBA_Environment *ev)
{
Cal *cal;
CalPrivate *priv;
time_t t_start, t_end;
- char *calobj;
+ GList *users = NULL;
+ GList *obj_list;
+ GNOME_Evolution_Calendar_CalObjSeq *seq;
cal = CAL (bonobo_object_from_servant (servant));
priv = cal->priv;
@@ -257,20 +260,46 @@ impl_Cal_get_free_busy (PortableServer_Servant servant,
return NULL;
}
- calobj = cal_backend_get_free_busy (priv->backend, t_start, t_end);
- if (calobj) {
- CORBA_char *calobj_copy;
+ /* convert the CORBA user list to a GList */
+ if (user_list) {
+ int i;
- calobj_copy = CORBA_string_dup (calobj);
- g_free (calobj);
- return calobj_copy;
+ for (i = 0; i < user_list->_length; i++)
+ users = g_list_append (users, user_list->_buffer[i]);
+ }
+
+ /* call the backend's get_free_busy method */
+ obj_list = cal_backend_get_free_busy (priv->backend, users, t_start, t_end);
+ g_list_free (users);
+ if (obj_list) {
+ GList *l;
+ gint count;
+ gint n;
+
+ count = g_list_length (obj_list);
+
+ seq = GNOME_Evolution_Calendar_CalObjSeq__alloc ();
+ CORBA_sequence_set_release (seq, TRUE);
+ seq->_length = count;
+ seq->_buffer = CORBA_sequence_GNOME_Evolution_Calendar_CalObj_allocbuf (count);
+
+ for (l = obj_list, n = 0; l; l = l->next, n++) {
+ gchar *calobj = (gchar *) l->data;
+
+ seq->_buffer[n] = CORBA_string_dup (calobj);
+ g_free (calobj);
+ }
+
+ g_list_free (obj_list);
+
+ return seq;
}
CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_GNOME_Evolution_Calendar_Cal_NotFound,
- NULL);
+ ex_GNOME_Evolution_Calendar_Cal_NotFound,
+ NULL);
- return NULL;
+ return NULL;
}
/* Cal::get_alarms_in_range method */