diff options
author | Arturo Espinosa <unammx@src.gnome.org> | 1999-07-29 08:26:11 +0800 |
---|---|---|
committer | Arturo Espinosa <unammx@src.gnome.org> | 1999-07-29 08:26:11 +0800 |
commit | 094deb7bca96f1dcf97952b93a7c4745cd799ebc (patch) | |
tree | f69e8fa8355218e37d08f0914f353a96da0b84fd /calendar/corba-cal.c | |
parent | c2c3a8ce6a51126ce0a5f368801b9af33372fb79 (diff) | |
download | gsoc2013-evolution-094deb7bca96f1dcf97952b93a7c4745cd799ebc.tar gsoc2013-evolution-094deb7bca96f1dcf97952b93a7c4745cd799ebc.tar.gz gsoc2013-evolution-094deb7bca96f1dcf97952b93a7c4745cd799ebc.tar.bz2 gsoc2013-evolution-094deb7bca96f1dcf97952b93a7c4745cd799ebc.tar.lz gsoc2013-evolution-094deb7bca96f1dcf97952b93a7c4745cd799ebc.tar.xz gsoc2013-evolution-094deb7bca96f1dcf97952b93a7c4745cd799ebc.tar.zst gsoc2013-evolution-094deb7bca96f1dcf97952b93a7c4745cd799ebc.zip |
Lots of more work on the sync stuff. It works pretty well now.
Lots of more work on the sync stuff. It works pretty well now.
I dont know why my pilot is not accepting the events I send to it though
Miguel.
svn path=/trunk/; revision=1040
Diffstat (limited to 'calendar/corba-cal.c')
-rw-r--r-- | calendar/corba-cal.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/calendar/corba-cal.c b/calendar/corba-cal.c index d78685bf90..8f92057d42 100644 --- a/calendar/corba-cal.c +++ b/calendar/corba-cal.c @@ -81,6 +81,7 @@ cal_repo_get_object_by_pilot_id (PortableServer_Servant servant, CORBA_char *ret; obj = calendar_object_find_by_pilot (gcal->cal, pilot_id); + printf ("Looking for [%d]\n", pilot_id); if (obj == NULL){ CORBA_exception_set (ev, CORBA_USER_EXCEPTION, @@ -148,6 +149,7 @@ cal_repo_update_object (PortableServer_Servant servant, obj = calendar_object_find_event (gcal->cal, uid); if (obj != NULL){ + printf ("ELIMINATING: %s -> %s\n", obj->uid, new_object->uid); calendar_remove_object (gcal->cal, obj); } @@ -155,6 +157,60 @@ cal_repo_update_object (PortableServer_Servant servant, } static void +cal_repo_update_pilot_id (PortableServer_Servant servant, + CORBA_char *uid, + CORBA_long pilot_id, + CORBA_long pilot_status, + CORBA_Environment *ev) +{ + GnomeCalendar *gcal = gnomecal_from_servant (servant); + iCalObject *obj; + + obj = calendar_object_find_event (gcal->cal, uid); + if (obj == NULL){ + CORBA_exception_set ( + ev, + CORBA_USER_EXCEPTION, + ex_GNOME_Calendar_Repository_NotFound, + ""); + return; + } + + obj->pilot_id = pilot_id; + obj->pilot_status = pilot_status; +} + +static CORBA_char * +cal_repo_get_updated_objects (PortableServer_Servant servant, + CORBA_Environment *ev) +{ + GnomeCalendar *gcal = gnomecal_from_servant (servant); + Calendar *dirty_cal; + GList *l; + CORBA_char *res; + char *str; + + dirty_cal = calendar_new ("Temporal"); + + for (l = gcal->cal->events; l; l = l->next){ + iCalObject *obj = l->data; + + if (obj->pilot_status != ICAL_PILOT_SYNC_MOD) + continue; + + obj = ical_object_duplicate (l->data); + + calendar_add_object (dirty_cal, obj); + } + str = calendar_get_as_vcal_string (dirty_cal); + res = CORBA_string_dup (str); + g_free (str); + calendar_destroy (dirty_cal); + + return res; +} + +static void cal_repo_done (PortableServer_Servant servant, CORBA_Environment *ev) { @@ -171,6 +227,9 @@ init_calendar_repo_class (void) calendar_repository_epv.get_id_from_pilot_id = cal_repo_get_id_from_pilot_id; calendar_repository_epv.delete_object = cal_repo_delete_object; calendar_repository_epv.update_object = cal_repo_update_object; + 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.done = cal_repo_done; calendar_repository_vepv.GNOME_Calendar_Repository_epv = |