aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-10-23 00:47:54 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-10-23 00:47:54 +0800
commit5e9d81e541449d811574d64c9f0e84e0cf24b536 (patch)
tree019c82df311027547629e1464b70b7f75e6d9e5e /calendar/pcs
parentc4b424decd46e0487272a7e6c18ed6454418de0f (diff)
downloadgsoc2013-evolution-5e9d81e541449d811574d64c9f0e84e0cf24b536.tar
gsoc2013-evolution-5e9d81e541449d811574d64c9f0e84e0cf24b536.tar.gz
gsoc2013-evolution-5e9d81e541449d811574d64c9f0e84e0cf24b536.tar.bz2
gsoc2013-evolution-5e9d81e541449d811574d64c9f0e84e0cf24b536.tar.lz
gsoc2013-evolution-5e9d81e541449d811574d64c9f0e84e0cf24b536.tar.xz
gsoc2013-evolution-5e9d81e541449d811574d64c9f0e84e0cf24b536.tar.zst
gsoc2013-evolution-5e9d81e541449d811574d64c9f0e84e0cf24b536.zip
write out the correct time in the control
2001-10-22 JP Rosevear <jpr@ximian.com> * gui/e-itip-control.c (set_date_label): write out the correct time in the control * pcs/cal.c (build_fb_seq): utility function to build sequences of f/b data (impl_Cal_get_free_busy): use above so we never return a NULL * conduits/calendar/calendar-conduit-config.h (calconduit_save_configuration): fix c/p error (calconduit_load_configuration): ditto svn path=/trunk/; revision=13876
Diffstat (limited to 'calendar/pcs')
-rw-r--r--calendar/pcs/cal.c57
1 files changed, 31 insertions, 26 deletions
diff --git a/calendar/pcs/cal.c b/calendar/pcs/cal.c
index b5d404bc7a..0d0e8e4a8b 100644
--- a/calendar/pcs/cal.c
+++ b/calendar/pcs/cal.c
@@ -241,6 +241,32 @@ impl_Cal_get_objects_in_range (PortableServer_Servant servant,
return seq;
}
+static GNOME_Evolution_Calendar_CalObjSeq *
+build_fb_seq (GList *obj_list)
+{
+ GNOME_Evolution_Calendar_CalObjSeq *seq;
+ GList *l;
+ int n, i;
+
+ n = g_list_length (obj_list);
+
+ seq = GNOME_Evolution_Calendar_CalObjSeq__alloc ();
+ CORBA_sequence_set_release (seq, TRUE);
+ seq->_length = n;
+ seq->_buffer = CORBA_sequence_GNOME_Evolution_Calendar_CalObj_allocbuf (n);
+
+ /* Fill the sequence */
+
+ for (i = 0, l = obj_list; l; i++, l = l->next) {
+ char *calobj;
+
+ calobj = l->data;
+ seq->_buffer[i] = CORBA_string_dup (calobj);
+ }
+
+ return seq;
+}
+
/* Cal::get_free_busy method */
static GNOME_Evolution_Calendar_CalObjSeq *
impl_Cal_get_free_busy (PortableServer_Servant servant,
@@ -264,7 +290,7 @@ impl_Cal_get_free_busy (PortableServer_Servant servant,
if (t_start > t_end || t_start == -1 || t_end == -1) {
bonobo_exception_set (ev, ex_GNOME_Evolution_Calendar_Cal_InvalidRange);
- return NULL;
+ return build_fb_seq (NULL);
}
/* convert the CORBA user list to a GList */
@@ -277,34 +303,13 @@ impl_Cal_get_free_busy (PortableServer_Servant servant,
/* call the backend's get_free_busy method */
obj_list = cal_backend_get_free_busy (priv->backend, users, t_start, t_end);
+ seq = build_fb_seq (obj_list);
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;
- }
-
- bonobo_exception_set (ev, ex_GNOME_Evolution_Calendar_Cal_NotFound);
+ if (obj_list == NULL)
+ bonobo_exception_set (ev, ex_GNOME_Evolution_Calendar_Cal_NotFound);
- return NULL;
+ return seq;
}
/* Cal::get_alarms_in_range method */