aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorJP Rosevear <jpr@helixcode.com>2000-10-16 22:03:03 +0800
committerJP Rosevear <jpr@src.gnome.org>2000-10-16 22:03:03 +0800
commit6793123da8bf07d588c2b7c403e8d070ef7d3e91 (patch)
tree536169756bd79dfe07adb4574eb4c5542bad3392 /calendar
parent45e9efcab1f4d35eb8f162f2dd3048f1a4f7c417 (diff)
downloadgsoc2013-evolution-6793123da8bf07d588c2b7c403e8d070ef7d3e91.tar.gz
gsoc2013-evolution-6793123da8bf07d588c2b7c403e8d070ef7d3e91.tar.zst
gsoc2013-evolution-6793123da8bf07d588c2b7c403e8d070ef7d3e91.zip
Remove pilot cruft. All pilot stuff is in the conduits now and uses the
2000-10-16 JP Rosevear <jpr@helixcode.com> * cal-client/cal-client.h: Remove pilot cruft. All pilot stuff is in the conduits now and uses the logging facility. * pcs/cal-backend-file.c: ditto * pcs/cal-backend.h: ditto * pcs/cal-backend.c: ditto * pcs/cal.c: ditto * pcs/cal.h: ditto * idl/evolution-calendar.idl: ditto * cal-util/cal-component.h: ditto * cal-util/cal-component.c: ditto * cal-client/cal-client.c: ditto * conduits/calendar/calendar-conduit.c (local_record_from_comp): Take a stab at storing recurrence stuff on the pilot properly * pcs/cal-backend.c (cal_backend_update_object): Don't log the event until after the update in case its a new item svn path=/trunk/; revision=5940
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog29
-rw-r--r--calendar/cal-client/cal-client.c68
-rw-r--r--calendar/cal-client/cal-client.h8
-rw-r--r--calendar/cal-util/cal-component.c169
-rw-r--r--calendar/cal-util/cal-component.h6
-rw-r--r--calendar/conduits/calendar/calendar-conduit.c41
-rw-r--r--calendar/idl/evolution-calendar.idl19
-rw-r--r--calendar/pcs/cal-backend-file.c78
-rw-r--r--calendar/pcs/cal-backend.c28
-rw-r--r--calendar/pcs/cal-backend.h9
-rw-r--r--calendar/pcs/cal.c53
11 files changed, 73 insertions, 435 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 892e06826d..073eb638df 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,32 @@
+2000-10-16 JP Rosevear <jpr@helixcode.com>
+
+ * cal-client/cal-client.h: Remove pilot cruft. All pilot stuff
+ is in the conduits now and uses the logging facility.
+
+ * pcs/cal-backend-file.c: ditto
+
+ * pcs/cal-backend.h: ditto
+
+ * pcs/cal-backend.c: ditto
+
+ * pcs/cal.c: ditto
+
+ * pcs/cal.h: ditto
+
+ * idl/evolution-calendar.idl: ditto
+
+ * cal-util/cal-component.h: ditto
+
+ * cal-util/cal-component.c: ditto
+
+ * cal-client/cal-client.c: ditto
+
+ * conduits/calendar/calendar-conduit.c (local_record_from_comp):
+ Take a stab at storing recurrence stuff on the pilot properly
+
+ * pcs/cal-backend.c (cal_backend_update_object): Don't log the
+ event until after the update in case its a new item
+
2000-10-16 Tuomas Kuosmanen <tigert@helixcode.com>
* gui/dayview.xpm, gui/workweekview.xpm, gui/weekview.xpm
diff --git a/calendar/cal-client/cal-client.c b/calendar/cal-client/cal-client.c
index 7b5f248d85..3e7daf80c4 100644
--- a/calendar/cal-client/cal-client.c
+++ b/calendar/cal-client/cal-client.c
@@ -674,74 +674,6 @@ cal_client_get_object (CalClient *client, const char *uid, CalComponent **comp)
return retval;
}
-CalClientGetStatus
-cal_client_get_uid_by_pilot_id (CalClient *client,
- unsigned long pilot_id,
- char **uid)
-{
- CalClientPrivate *priv;
- CORBA_Environment ev;
- CalClientGetStatus retval;
- char *uid_str;
-
- g_return_val_if_fail (client != NULL, CAL_CLIENT_GET_NOT_FOUND);
- g_return_val_if_fail (IS_CAL_CLIENT (client),
- CAL_CLIENT_GET_NOT_FOUND);
-
- priv = client->priv;
- g_return_val_if_fail (priv->load_state == LOAD_STATE_LOADED,
- CAL_CLIENT_GET_NOT_FOUND);
-
- retval = CAL_CLIENT_GET_NOT_FOUND;
- *uid = NULL;
-
- CORBA_exception_init (&ev);
- uid_str = Evolution_Calendar_Cal_get_uid_by_pilot_id (priv->cal, pilot_id, &ev);
-
- if (ev._major == CORBA_USER_EXCEPTION &&
- strcmp (CORBA_exception_id (&ev),
- ex_Evolution_Calendar_Cal_NotFound) == 0)
- goto out;
- else if (ev._major != CORBA_NO_EXCEPTION) {
- //g_message ("cal_client_get_object(): could not get the object");
- goto out;
- }
-
- if (uid_str) {
- retval = CAL_CLIENT_GET_SUCCESS;
- (*uid) = g_strdup (uid_str);
- CORBA_free (uid_str);
- }
-
- out:
-
- CORBA_exception_free (&ev);
- return retval;
-}
-
-
-
-void cal_client_update_pilot_id (CalClient *client, char *uid,
- unsigned long pilot_id,
- unsigned long pilot_status)
-{
- CalClientPrivate *priv;
- CORBA_Environment ev;
-
- g_return_if_fail (client != NULL);
- g_return_if_fail (IS_CAL_CLIENT (client));
-
- priv = client->priv;
- g_return_if_fail (priv->load_state == LOAD_STATE_LOADED);
-
- CORBA_exception_init (&ev);
- Evolution_Calendar_Cal_update_pilot_id (priv->cal, uid,
- pilot_id, pilot_status,
- &ev);
-
- CORBA_exception_free (&ev);
-}
-
/* Builds an UID list out of a CORBA UID sequence */
static GList *
build_uid_list (Evolution_Calendar_CalObjUIDSeq *seq)
diff --git a/calendar/cal-client/cal-client.h b/calendar/cal-client/cal-client.h
index 9853c63e2c..fd40c424d9 100644
--- a/calendar/cal-client/cal-client.h
+++ b/calendar/cal-client/cal-client.h
@@ -92,14 +92,6 @@ CalClientGetStatus cal_client_get_object (CalClient *client,
const char *uid,
CalComponent **comp);
-CalClientGetStatus cal_client_get_uid_by_pilot_id (CalClient *client,
- unsigned long pilot_id,
- char **uid);
-
-void cal_client_update_pilot_id (CalClient *client, char *uid,
- unsigned long pilot_id,
- unsigned long pilot_status);
-
GList *cal_client_get_uids (CalClient *client, CalObjType type);
GList *cal_client_get_changed_uids (CalClient *client, CalObjType type, time_t since);
diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c
index cf7e3f358a..4efb29a610 100644
--- a/calendar/cal-util/cal-component.c
+++ b/calendar/cal-util/cal-component.c
@@ -97,9 +97,6 @@ struct _CalComponentPrivate {
icalproperty *transparency;
icalproperty *url;
- icalproperty *pilot_id;
- icalproperty *pilot_status;
-
/* Whether we should increment the sequence number when piping the
* object over the wire.
*/
@@ -571,13 +568,6 @@ scan_property (CalComponent *comp, icalproperty *prop)
priv->url = prop;
break;
- case ICAL_X_PROPERTY:
- if (!strcmp (icalproperty_get_x_name (prop), "X-PILOT-ID"))
- priv->pilot_id = prop;
- if (!strcmp (icalproperty_get_x_name (prop), "X-PILOT-STATUS"))
- priv->pilot_status = prop;
- break;
-
default:
break;
}
@@ -3005,167 +2995,8 @@ cal_component_set_url (CalComponent *comp, const char *url)
}
}
-/**
- * cal_component_get_pilot_id:
- * @comp: A calendar component object.
- * @pilot_id: Return value for the pilot ID.
- *
- * Queries the pilot id of a calendar component object, if any.
- **/
-void
-cal_component_get_pilot_id (CalComponent *comp, unsigned long **pilot_id)
-{
- CalComponentPrivate *priv;
-
- g_return_if_fail (comp != NULL);
- g_return_if_fail (IS_CAL_COMPONENT (comp));
-
- priv = comp->priv;
- g_return_if_fail (priv->icalcomp != NULL);
-
- /* Pilot id might want to be recordid_t */
- if (priv->pilot_id) {
- icalvalue *value;
- char *text;
-
- value = icalproperty_get_value (priv->pilot_id);
- text = icalvalue_get_text (value);
-
- *pilot_id = g_new (unsigned long, 1);
- **pilot_id = strtoul (text, NULL, 0);
- } else {
- *pilot_id = NULL;
- }
-}
-
-/**
- * cal_component_set_pilot_id:
- * @comp: A calendar component object.
- * @pilot_id: Return value for the pilot ID.
- *
- * Sets the pilot id of a clanedar component object.
- **/
-void
-cal_component_set_pilot_id (CalComponent *comp, unsigned long *pilot_id)
-{
- CalComponentPrivate *priv;
- icalvalue *value;
- char text[256];
-
- g_return_if_fail (comp != NULL);
- g_return_if_fail (IS_CAL_COMPONENT (comp));
-
- priv = comp->priv;
- g_return_if_fail (priv->icalcomp != NULL);
-
- /* pilot_id maybe should be recordid_t */
- if (!pilot_id) {
- if (priv->pilot_id) {
- icalcomponent_remove_property (priv->icalcomp,
- priv->pilot_id);
- icalproperty_free (priv->pilot_id);
- priv->pilot_id = NULL;
- }
-
- return;
- }
-
- /* iCalendar spec does not support unsigned longs directly */
- g_snprintf (text, 256, "%lu", *pilot_id);
- value = icalvalue_new_text (text);
-
- if (!priv->pilot_id) {
- priv->pilot_id = icalproperty_new (ICAL_X_PROPERTY);
- icalproperty_set_x_name (priv->pilot_id, "X-PILOT-ID");
- icalcomponent_add_property (priv->icalcomp, priv->pilot_id);
- }
-
- icalproperty_set_value (priv->pilot_id, value);
-}
-
-/**
- * cal_component_get_pilot_status:
- * @comp: A calendar component object.
- * @pilot_status: Return value for the pilot sync status.
- *
- * Queries the pilot status of a calendar component object, if any.
- **/
-void
-cal_component_get_pilot_status (CalComponent *comp,
- unsigned long **pilot_status)
-{
- CalComponentPrivate *priv;
-
- g_return_if_fail (comp != NULL);
- g_return_if_fail (IS_CAL_COMPONENT (comp));
-
- priv = comp->priv;
- g_return_if_fail (priv->icalcomp != NULL);
-
- /* Pilot id might want to be recordid_t */
- if (priv->pilot_status) {
- icalvalue *value;
- char *text;
-
- value = icalproperty_get_value (priv->pilot_status);
- text = icalvalue_get_text (value);
-
- *pilot_status = g_new (unsigned long, 1);
- **pilot_status = strtoul (text, NULL, 0);
- } else {
- *pilot_status = NULL;
- }
-}
-
-/**
- * cal_component_set_pilot_id:
- * @comp: A calendar component object.
- * @pilot_id: Return value for the pilot ID.
- *
- * Sets the pilot id of a clanedar component object.
- **/
-void
-cal_component_set_pilot_status (CalComponent *comp,
- unsigned long *pilot_status)
-{
- CalComponentPrivate *priv;
- icalvalue *value;
- char text[256];
-
- g_return_if_fail (comp != NULL);
- g_return_if_fail (IS_CAL_COMPONENT (comp));
-
- priv = comp->priv;
- g_return_if_fail (priv->icalcomp != NULL);
-
- if (!pilot_status) {
- if (priv->pilot_status) {
- icalcomponent_remove_property (priv->icalcomp,
- priv->pilot_status);
- icalproperty_free (priv->pilot_status);
- priv->pilot_status = NULL;
- }
-
- return;
- }
-
- /* iCalendar spec does not support unsigned longs directly */
- g_snprintf (text, 256, "%lu", *pilot_status);
- value = icalvalue_new_text (text);
-
- if (!priv->pilot_status) {
- priv->pilot_status = icalproperty_new (ICAL_X_PROPERTY);
- icalproperty_set_x_name (priv->pilot_status, "X-PILOT-STATUS");
- icalcomponent_add_property (priv->icalcomp, priv->pilot_status);
- }
-
- icalproperty_set_value (priv->pilot_status, value);
-}
-
-
-
/**
* cal_component_free_categories_list:
* @categ_list: List of category strings.
diff --git a/calendar/cal-util/cal-component.h b/calendar/cal-util/cal-component.h
index 749f268fcd..91d62ae548 100644
--- a/calendar/cal-util/cal-component.h
+++ b/calendar/cal-util/cal-component.h
@@ -244,12 +244,6 @@ void cal_component_set_transparency (CalComponent *comp, CalComponentTransparenc
void cal_component_get_url (CalComponent *comp, const char **url);
void cal_component_set_url (CalComponent *comp, const char *url);
-void cal_component_get_pilot_id (CalComponent *comp, unsigned long **pilot_id);
-void cal_component_set_pilot_id (CalComponent *comp, unsigned long *pilot_id);
-
-void cal_component_get_pilot_status (CalComponent *comp, unsigned long **pilot_status);
-void cal_component_set_pilot_status (CalComponent *comp, unsigned long *pilot_status);
-
/* Functions to free returned values */
void cal_component_free_categories_list (GSList *categ_list);
diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c
index 757dd66958..37661377b1 100644
--- a/calendar/conduits/calendar/calendar-conduit.c
+++ b/calendar/conduits/calendar/calendar-conduit.c
@@ -415,7 +415,8 @@ local_record_from_comp (ECalLocalRecord *local, CalComponent *comp, ECalConduitC
CalComponentDateTime dt;
time_t dt_time;
CalComponentClassification classif;
-
+ int i;
+
LOG ("local_record_from_comp\n");
g_return_if_fail (local != NULL);
@@ -463,6 +464,44 @@ local_record_from_comp (ECalLocalRecord *local, CalComponent *comp, ECalConduitC
local->appt->event = 1;
}
+ /* Recurrence Rules */
+ local->appt->repeatType = repeatNone;
+
+ if (cal_component_has_rrules (comp)) {
+ GSList *list;
+ struct icalrecurrencetype *recur;
+
+ cal_component_get_rrule_list (comp, &list);
+ recur = list->data;
+
+ switch (recur->freq) {
+ case ICAL_DAILY_RECURRENCE:
+ local->appt->repeatType = repeatDaily;
+ break;
+ case ICAL_WEEKLY_RECURRENCE:
+ local->appt->repeatType = repeatWeekly;
+ for (i = 0; i<= 7 && recur->by_day[i] != SHRT_MAX; i++)
+ local->appt->repeatDays[0] = 0;
+ break;
+ case ICAL_MONTHLY_RECURRENCE:
+ if (recur->by_month_day[0] != SHRT_MAX) {
+ local->appt->repeatType = repeatMonthlyByDate;
+ }
+ break;
+ case ICAL_YEARLY_RECURRENCE:
+ local->appt->repeatType = repeatYearly;
+ break;
+ default:
+ break;
+ }
+
+ if (local->appt->repeatType != repeatNone) {
+ local->appt->repeatFrequency = recur->interval;
+ }
+
+ cal_component_free_recur_list (list);
+ }
+
cal_component_get_classification (comp, &classif);
if (classif == CAL_COMPONENT_CLASS_PRIVATE)
diff --git a/calendar/idl/evolution-calendar.idl b/calendar/idl/evolution-calendar.idl
index 27c7971057..ab80ff8702 100644
--- a/calendar/idl/evolution-calendar.idl
+++ b/calendar/idl/evolution-calendar.idl
@@ -49,9 +49,6 @@ module Calendar {
/* Used to store a time_t */
typedef unsigned long Time_t;
- /* Used to store pilot IDs */
- typedef unsigned long PilotID;
-
/* An instance of a calendar object that actually occurs. These are
* "virtual" objects in that they are used to represent instances of
* recurring events and alarms. "Real" objects just contain the
@@ -127,22 +124,6 @@ module Calendar {
raises (NotFound, InvalidRange);
- /* something
- *
- */
- CalObjUID get_uid_by_pilot_id (in PilotID pilotid)
- raises (NotFound);
-
-
- /*
- * update_pilot_id:
- * @uid: Unique identifier for the event we want to update
- * @pilot_id: new ID assigned by the pilot
- * @pilot_status: Status to flag the event with
- */
- void update_pilot_id (in CalObjUID uid, in PilotID pilot_id, in unsigned long pilot_status)
- raises (NotFound);
-
/* Updates an object by adding it if it does not exist or by
* changing an existing one.
*/
diff --git a/calendar/pcs/cal-backend-file.c b/calendar/pcs/cal-backend-file.c
index 959224db6a..97e96d3d44 100644
--- a/calendar/pcs/cal-backend-file.c
+++ b/calendar/pcs/cal-backend-file.c
@@ -44,13 +44,6 @@ struct _CalBackendFilePrivate {
*/
GHashTable *comp_uid_hash;
- /* All the uids in the calendar, hashed by pilot ID. The
- * hash key *is* the pilot id returned by cal_component_get_pilot_id();
- * it is not copied, so don't free it when you remove an object from
- * the hash table.
- */
- GHashTable *comp_pilot_hash;
-
/* All event, to-do, and journal components in the calendar; they are
* here just for easy access (i.e. so that you don't have to iterate
* over the comp_uid_hash). If you need *all* the components in the
@@ -88,12 +81,6 @@ static gboolean cal_backend_file_get_alarms_for_object (CalBackend *backend, con
static gboolean cal_backend_file_update_object (CalBackend *backend, const char *uid,
const char *calobj);
static gboolean cal_backend_file_remove_object (CalBackend *backend, const char *uid);
-static char *cal_backend_file_get_uid_by_pilot_id (CalBackend *backend, unsigned long int pilot_id);
-static void cal_backend_file_update_pilot_id (CalBackend *backend,
- const char *uid,
- unsigned long int pilot_id,
- unsigned long int pilot_status);
-
static CalBackendClass *parent_class;
@@ -158,8 +145,6 @@ cal_backend_file_class_init (CalBackendFileClass *class)
backend_class->get_alarms_for_object = cal_backend_file_get_alarms_for_object;
backend_class->update_object = cal_backend_file_update_object;
backend_class->remove_object = cal_backend_file_remove_object;
- backend_class->get_uid_by_pilot_id = cal_backend_file_get_uid_by_pilot_id;
- backend_class->update_pilot_id = cal_backend_file_update_pilot_id;
}
/* Object initialization function for the file backend */
@@ -281,11 +266,6 @@ cal_backend_file_destroy (GtkObject *object)
priv->comp_uid_hash = NULL;
}
- if (priv->comp_pilot_hash) {
- g_hash_table_destroy (priv->comp_pilot_hash);
- priv->comp_pilot_hash = NULL;
- }
-
g_list_free (priv->events);
g_list_free (priv->todos);
g_list_free (priv->journals);
@@ -477,7 +457,6 @@ add_component (CalBackendFile *cbfile, CalComponent *comp, gboolean add_to_tople
CalBackendFilePrivate *priv;
GList **list;
const char *uid;
- unsigned long *pilot_id;
priv = cbfile->priv;
@@ -506,12 +485,6 @@ add_component (CalBackendFile *cbfile, CalComponent *comp, gboolean add_to_tople
cal_component_get_uid (comp, &uid);
g_hash_table_insert (priv->comp_uid_hash, (char *)uid, comp);
- /* Update the pilot list, if there is a pilot id */
- cal_component_get_pilot_id (comp, &pilot_id);
- if (pilot_id)
- g_hash_table_insert (priv->comp_pilot_hash,
- pilot_id, (char *)uid);
-
*list = g_list_prepend (*list, comp);
/* Put the object in the toplevel component if required */
@@ -536,7 +509,6 @@ remove_component (CalBackendFile *cbfile, CalComponent *comp)
CalBackendFilePrivate *priv;
icalcomponent *icalcomp;
const char *uid;
- unsigned long *pilot_id;
GList **list, *l;
priv = cbfile->priv;
@@ -552,9 +524,6 @@ remove_component (CalBackendFile *cbfile, CalComponent *comp)
cal_component_get_uid (comp, &uid);
g_hash_table_remove (priv->comp_uid_hash, uid);
- cal_component_get_pilot_id (comp, &pilot_id);
- if (pilot_id)
- g_hash_table_remove (priv->comp_pilot_hash, pilot_id);
switch (cal_component_get_vtype (comp)) {
case CAL_COMPONENT_EVENT:
@@ -686,7 +655,6 @@ cal_backend_file_load (CalBackend *backend, GnomeVFSURI *uri)
priv->icalcomp = icalcomp;
priv->comp_uid_hash = g_hash_table_new (g_str_hash, g_str_equal);
- priv->comp_pilot_hash = g_hash_table_new (g_int_hash, g_int_equal);
scan_vcalendar (cbfile);
/* Clean up */
@@ -734,7 +702,6 @@ cal_backend_file_create (CalBackend *backend, GnomeVFSURI *uri)
g_assert (priv->comp_uid_hash == NULL);
priv->comp_uid_hash = g_hash_table_new (g_str_hash, g_str_equal);
- priv->comp_pilot_hash = g_hash_table_new (g_int_hash, g_int_equal);
/* Clean up */
if (priv->uri)
@@ -1104,10 +1071,6 @@ cal_backend_file_update_object (CalBackend *backend, const char *uid, const char
remove_component (cbfile, old_comp);
add_component (cbfile, comp, TRUE);
-#if 0
- /* FIXME */
- new_ico->pilot_status = ICAL_PILOT_SYNC_MOD;
-#endif
mark_dirty (cbfile);
@@ -1145,44 +1108,3 @@ cal_backend_file_remove_object (CalBackend *backend, const char *uid)
return TRUE;
}
-/* Get_uid_by_pilot_id handler for the file backend */
-static char *
-cal_backend_file_get_uid_by_pilot_id (CalBackend *backend, unsigned long pilot_id)
-{
- CalBackendFile *cbfile;
- CalBackendFilePrivate *priv;
- char *uid;
-
- cbfile = CAL_BACKEND_FILE (backend);
- priv = cbfile->priv;
-
- uid = g_hash_table_lookup (priv->comp_pilot_hash, &pilot_id);
-
- return g_strdup (uid);
-}
-
-/* Update_pilot_id handler for the file backend */
-static void
-cal_backend_file_update_pilot_id (CalBackend *backend,
- const char *uid,
- unsigned long pilot_id,
- unsigned long pilot_status)
-{
- CalBackendFile *cbfile;
- CalBackendFilePrivate *priv;
- CalComponent *comp;
-
- cbfile = CAL_BACKEND_FILE (backend);
- priv = cbfile->priv;
-
- g_return_if_fail (priv->icalcomp != NULL);
- g_return_if_fail (uid != NULL);
-
- comp = lookup_component (cbfile, uid);
- if (!comp)
- return;
-
- cal_component_set_pilot_id (comp, &pilot_id);
- cal_component_set_pilot_status (comp, &pilot_status);
-}
-
diff --git a/calendar/pcs/cal-backend.c b/calendar/pcs/cal-backend.c
index 89049d5f8c..beca760be1 100644
--- a/calendar/pcs/cal-backend.c
+++ b/calendar/pcs/cal-backend.c
@@ -399,27 +399,6 @@ cal_backend_get_alarms_for_object (CalBackend *backend, const char *uid,
return (* CLASS (backend)->get_alarms_for_object) (backend, uid, start, end, alarms);
}
-
-char *cal_backend_get_uid_by_pilot_id (CalBackend *backend, unsigned long int pilot_id)
-{
- g_return_val_if_fail (backend != NULL, FALSE);
- g_return_val_if_fail (IS_CAL_BACKEND (backend), FALSE);
- g_assert (CLASS(backend)->get_uid_by_pilot_id != NULL);
- return (* CLASS(backend)->get_uid_by_pilot_id) (backend, pilot_id);
-}
-
-
-void cal_backend_update_pilot_id (CalBackend *backend, const char *uid,
- unsigned long int pilot_id,
- unsigned long int pilot_status)
-{
- g_return_if_fail (backend != NULL);
- g_return_if_fail (IS_CAL_BACKEND (backend));
- g_assert (CLASS(backend)->update_pilot_id != NULL);
- (* CLASS(backend)->update_pilot_id) (backend, uid,
- pilot_id, pilot_status);
-}
-
/* Internal logging stuff */
typedef enum {
CAL_BACKEND_UPDATED,
@@ -700,12 +679,13 @@ cal_backend_update_object (CalBackend *backend, const char *uid, const char *cal
g_return_val_if_fail (calobj != NULL, FALSE);
g_assert (CLASS (backend)->update_object != NULL);
- cot = (* CLASS (backend)->get_type_by_uid) (backend, uid);
result = (* CLASS (backend)->update_object) (backend, uid, calobj);
- if (result)
+ if (result) {
+ cot = (* CLASS (backend)->get_type_by_uid) (backend, uid);
cal_backend_log_entry (backend, uid, cot, CAL_BACKEND_UPDATED);
-
+ }
+
return result;
}
diff --git a/calendar/pcs/cal-backend.h b/calendar/pcs/cal-backend.h
index 77bba93835..44262c10ca 100644
--- a/calendar/pcs/cal-backend.h
+++ b/calendar/pcs/cal-backend.h
@@ -80,9 +80,6 @@ struct _CalBackendClass {
GList **alarms);
gboolean (* update_object) (CalBackend *backend, const char *uid, const char *calobj);
gboolean (* remove_object) (CalBackend *backend, const char *uid);
- char *(* get_uid_by_pilot_id) (CalBackend *backend, unsigned long int pilot_id);
- void (* update_pilot_id) (CalBackend *backend, const char *uid,
- unsigned long int pilot_id, unsigned long int pilot_status);
};
GtkType cal_backend_get_type (void);
@@ -119,12 +116,6 @@ gboolean cal_backend_remove_object (CalBackend *backend, const char *uid);
void cal_backend_last_client_gone (CalBackend *backend);
-char *cal_backend_get_uid_by_pilot_id (CalBackend *backend, unsigned long int pilot_id);
-
-void cal_backend_update_pilot_id (CalBackend *backend, const char *uid,
- unsigned long int pilot_id,
- unsigned long int pilot_status);
-
END_GNOME_DECLS
diff --git a/calendar/pcs/cal.c b/calendar/pcs/cal.c
index cb302cf9be..35d98abd64 100644
--- a/calendar/pcs/cal.c
+++ b/calendar/pcs/cal.c
@@ -546,57 +546,6 @@ Cal_remove_object (PortableServer_Servant servant,
NULL);
}
-
-
-/* Cal::get_uid_by_pilot_id method */
-static Evolution_Calendar_CalObjUID
-Cal_get_uid_by_pilot_id (PortableServer_Servant servant,
- const Evolution_Calendar_PilotID pilot_id,
- CORBA_Environment *ev)
-{
- Cal *cal;
- CalPrivate *priv;
- char *uid;
-
- cal = CAL (bonobo_object_from_servant (servant));
- priv = cal->priv;
-
- uid = cal_backend_get_uid_by_pilot_id (priv->backend, pilot_id);
-
- if (uid) {
- CORBA_char *uid_copy;
-
- uid_copy = CORBA_string_dup (uid);
- g_free (uid);
- return uid_copy;
- } else {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_Evolution_Calendar_Cal_NotFound,
- NULL);
- return NULL;
- }
-}
-
-
-/* Cal::update_pilot_id method */
-static void
-Cal_update_pilot_id (PortableServer_Servant servant,
- const Evolution_Calendar_CalObjUID uid,
- const Evolution_Calendar_PilotID pilot_id,
- const CORBA_unsigned_long pilot_status,
- CORBA_Environment * ev)
-{
- Cal *cal;
- CalPrivate *priv;
-
- cal = CAL (bonobo_object_from_servant (servant));
- priv = cal->priv;
-
- cal_backend_update_pilot_id (priv->backend, uid,
- pilot_id, pilot_status);
-}
-
-
/**
* cal_get_epv:
* @void:
@@ -621,8 +570,6 @@ cal_get_epv (void)
epv->get_alarms_for_object = Cal_get_alarms_for_object;
epv->update_object = Cal_update_object;
epv->remove_object = Cal_remove_object;
- epv->get_uid_by_pilot_id = Cal_get_uid_by_pilot_id;
- epv->update_pilot_id = Cal_update_pilot_id;
return epv;
}