diff options
author | Eskil Heyn Olsen <eskil@src.gnome.org> | 1999-09-25 22:30:22 +0800 |
---|---|---|
committer | Eskil Heyn Olsen <eskil@src.gnome.org> | 1999-09-25 22:30:22 +0800 |
commit | 008fb50b9f799f202453759650a2b4ec4fc2b5af (patch) | |
tree | 90f8d7ff4d1afc99ae2e77c6ee1722853a0e97d4 /calendar/gui/corba-cal.c | |
parent | 6ed1a40852d43229bec2509d7d0b9e35efde163f (diff) | |
download | gsoc2013-evolution-008fb50b9f799f202453759650a2b4ec4fc2b5af.tar.gz gsoc2013-evolution-008fb50b9f799f202453759650a2b4ec4fc2b5af.tar.zst gsoc2013-evolution-008fb50b9f799f202453759650a2b4ec4fc2b5af.zip |
the g_free that was commented out since glib said was a duplicate free,
* corba-cal.c: the g_free that was commented out since glib said
was a duplicate free, was supposed to be a free.
* GnomeCal.idl/corba-cal.c: added a get_object_id_list and a
get_objects_by_id_list. Latter is not done.
* calendar-conduit.c: rewrote the way the conduit iterates over
records. It no longers fetches all entries (since that didn't work
with more then 285 entries. It now fetches the id list, and gets
each record. (will be using get_objects_by_id_list to get records
in amounts of 10 or so later, to reduce amount of corba calls).
* calendar-conduit.c: now sets alarm parameters when transferring
from gnomecal to pilot.
svn path=/trunk/; revision=1257
Diffstat (limited to 'calendar/gui/corba-cal.c')
-rw-r--r-- | calendar/gui/corba-cal.c | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/calendar/gui/corba-cal.c b/calendar/gui/corba-cal.c index 49978a5bf1..ddeb5ccb45 100644 --- a/calendar/gui/corba-cal.c +++ b/calendar/gui/corba-cal.c @@ -198,33 +198,39 @@ cal_repo_get_objects (PortableServer_Servant servant, CORBA_Environment *ev) { GnomeCalendar *gcal = gnomecal_from_servant (servant); - Calendar *dirty_cal; - GList *l; char *str; CORBA_char *res; - int items_dbg=0; - g_message("in cal_repo_get_objects"); - - dirty_cal = calendar_new ("Temporal"); - - for (l = gcal->cal->events; l; l = l->next){ - iCalObject *obj = l->data; + str = calendar_get_as_vcal_string (gcal->cal); + g_message("length of result is %d",strlen(str)); + res = CORBA_string_dup (str); + free(str); /* ...get_as_vcal calls writeMemVObject, which uses realloc to + allocate this string */ - obj = ical_object_duplicate (l->data); + return res; +} - calendar_add_object (dirty_cal, obj); +static GNOME_Calendar_Repository_String_Sequence* +cal_repo_get_object_id_list(PortableServer_Servant servant, + CORBA_Environment *ev) +{ + GnomeCalendar *gcal = gnomecal_from_servant (servant); + GList *l; + GNOME_Calendar_Repository_String_Sequence *result; + int counter; + + result = GNOME_Calendar_Repository_String_Sequence__alloc(); + result->_length = g_list_length(gcal->cal->events); + result->_buffer = CORBA_sequence_CORBA_string_allocbuf(result->_length); - items_dbg++; + counter = 0; + for (l = gcal->cal->events ; l; l = l->next){ + iCalObject *obj = l->data; + result->_buffer[counter] = CORBA_string_dup(obj->uid); + counter++; } - str = calendar_get_as_vcal_string (dirty_cal); - res = CORBA_string_dup (str); - /* g_free (str); glib with memcheck enabled says this is already freed */ - calendar_destroy (dirty_cal); - g_message("added %d items to return value",items_dbg); - - return res; + return result; } static CORBA_char * @@ -277,6 +283,7 @@ init_calendar_repo_class (void) calendar_repository_epv.get_objects = cal_repo_get_objects; calendar_repository_epv.get_updated_objects = cal_repo_get_updated_objects; calendar_repository_epv.update_pilot_id = cal_repo_update_pilot_id; + calendar_repository_epv.get_object_id_list = cal_repo_get_object_id_list; calendar_repository_epv.done = cal_repo_done; |