aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs
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/pcs
parent45e9efcab1f4d35eb8f162f2dd3048f1a4f7c417 (diff)
downloadgsoc2013-evolution-6793123da8bf07d588c2b7c403e8d070ef7d3e91.tar
gsoc2013-evolution-6793123da8bf07d588c2b7c403e8d070ef7d3e91.tar.gz
gsoc2013-evolution-6793123da8bf07d588c2b7c403e8d070ef7d3e91.tar.bz2
gsoc2013-evolution-6793123da8bf07d588c2b7c403e8d070ef7d3e91.tar.lz
gsoc2013-evolution-6793123da8bf07d588c2b7c403e8d070ef7d3e91.tar.xz
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/pcs')
-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
4 files changed, 4 insertions, 164 deletions
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;
}