summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2003-12-21 17:04:54 +0000
committerJP Rosevear <jpr@src.gnome.org>2003-12-21 17:04:54 +0000
commit5c27b7e6c22cfef1ee62ac3af68effa3ea5e5db6 (patch)
tree5bcb80aae6f8dee5e631e115c31aa26ebd99cd26
parentf165aca04fdc814a2ce8617f7a997a3f85841f8d (diff)
downloadevolution-data-server-5c27b7e6c22cfef1ee62ac3af68effa3ea5e5db6.tar.gz
update protos
2003-12-21 JP Rosevear <jpr@ximian.com> * libecal/e-cal.h: update protos * libecal/e-cal.c: use ECalSourceType (convert_type): convert and ECalSourceType to a corba equivalent (fetch_corba_cal): use ECalSourceType (e_cal_new): ditto (e_cal_new_from_uri): ditto (e_cal_generate_instances): does not need a type arg * libecal/e-cal-util.h: remove CalObjType * libecal/client-test.c (create_client): use ECalSourceType (main): ditto
-rw-r--r--calendar/ChangeLog16
-rw-r--r--calendar/libecal/client-test.c4
-rw-r--r--calendar/libecal/e-cal-util.h8
-rw-r--r--calendar/libecal/e-cal.c30
-rw-r--r--calendar/libecal/e-cal.h14
5 files changed, 51 insertions, 21 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 122a90ae9..a6694547f 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,21 @@
2003-12-21 JP Rosevear <jpr@ximian.com>
+ * libecal/e-cal.h: update protos
+
+ * libecal/e-cal.c: use ECalSourceType
+ (convert_type): convert and ECalSourceType to a corba equivalent
+ (fetch_corba_cal): use ECalSourceType
+ (e_cal_new): ditto
+ (e_cal_new_from_uri): ditto
+ (e_cal_generate_instances): does not need a type arg
+
+ * libecal/e-cal-util.h: remove CalObjType
+
+ * libecal/client-test.c (create_client): use ECalSourceType
+ (main): ditto
+
+2003-12-21 JP Rosevear <jpr@ximian.com>
+
* backends/file/e-cal-backend-file.c (open_cal): set the uri
before scanning the vcalendar because we may have to fix duplicate
UIDs (and hence save the calendar)
diff --git a/calendar/libecal/client-test.c b/calendar/libecal/client-test.c
index ef3019ffd..4c8775fc5 100644
--- a/calendar/libecal/client-test.c
+++ b/calendar/libecal/client-test.c
@@ -138,7 +138,7 @@ client_destroy_cb (gpointer data, GObject *object)
/* Creates a calendar client and tries to load the specified URI into it */
static void
-create_client (ECal **client, const gchar *uri, CalObjType type, gboolean only_if_exists)
+create_client (ECal **client, const gchar *uri, ECalSourceType type, gboolean only_if_exists)
{
ECalView *query;
GError *error = NULL;
@@ -196,7 +196,7 @@ main (int argc, char **argv)
#if 0
source = e_source_new ("test-source", "file:///home/gnome24-evolution-new-calendar/evolution/local/Calendar");
#endif
- create_client (&client1, "file:///home/hpj/.evolution/calendar/local/OnThisComputer/Pakk", CALOBJ_TYPE_EVENT, FALSE);
+ create_client (&client1, "file:///home/hpj/.evolution/calendar/local/OnThisComputer/Pakk", E_CAL_SOURCE_TYPE_EVENT, FALSE);
// create_client (&client2, "file:///tmp/tasks", TRUE);
bonobo_main ();
diff --git a/calendar/libecal/e-cal-util.h b/calendar/libecal/e-cal-util.h
index cf2d00e05..ab55094d1 100644
--- a/calendar/libecal/e-cal-util.h
+++ b/calendar/libecal/e-cal-util.h
@@ -43,14 +43,6 @@ typedef struct {
void cal_obj_instance_list_free (GList *list);
-/* Used for multiple UID queries */
-typedef enum {
- CALOBJ_TYPE_EVENT = 1 << 0,
- CALOBJ_TYPE_TODO = 1 << 1,
- CALOBJ_TYPE_JOURNAL = 1 << 2,
- CALOBJ_TYPE_ANY = 0x07
-} CalObjType;
-
/* Used for modifying objects */
typedef enum {
CALOBJ_MOD_THIS = 1 << 0,
diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c
index 0b86cf106..17fba8c63 100644
--- a/calendar/libecal/e-cal.c
+++ b/calendar/libecal/e-cal.c
@@ -63,7 +63,7 @@ struct _ECalPrivate {
*/
ESource *source;
char *uri;
- CalObjType type;
+ ECalSourceType type;
ECalendarOp *current_op;
@@ -182,6 +182,23 @@ cal_mode_enum_get_type (void)
return cal_mode_enum_type;
}
+static GNOME_Evolution_Calendar_CalObjType
+convert_type (ECalSourceType type)
+{
+ switch (type){
+ case E_CAL_SOURCE_TYPE_EVENT:
+ return GNOME_Evolution_Calendar_TYPE_EVENT;
+ case E_CAL_SOURCE_TYPE_TODO:
+ return GNOME_Evolution_Calendar_TYPE_TODO;
+ case E_CAL_SOURCE_TYPE_JOURNAL:
+ return GNOME_Evolution_Calendar_TYPE_JOURNAL;
+ default:
+ g_assert_not_reached ();
+ }
+
+ return GNOME_Evolution_Calendar_TYPE_ANY;
+}
+
/* EBookOp calls */
static ECalendarOp*
@@ -1188,7 +1205,7 @@ e_cal_get_type (void)
static gboolean
-fetch_corba_cal (ECal *ecal, ESource *source, CalObjType type)
+fetch_corba_cal (ECal *ecal, ESource *source, ECalSourceType type)
{
ECalPrivate *priv;
GList *f;
@@ -1224,7 +1241,7 @@ fetch_corba_cal (ECal *ecal, ESource *source, CalObjType type)
CORBA_exception_init (&ev);
- cal = GNOME_Evolution_Calendar_CalFactory_getCal (f->data, source_xml, priv->type,
+ cal = GNOME_Evolution_Calendar_CalFactory_getCal (f->data, source_xml, convert_type (priv->type),
BONOBO_OBJREF (priv->listener), &ev);
if (BONOBO_EX (&ev))
continue;
@@ -1252,7 +1269,7 @@ fetch_corba_cal (ECal *ecal, ESource *source, CalObjType type)
* not be constructed because it could not contact the calendar server.
**/
ECal *
-e_cal_new (ESource *source, CalObjType type)
+e_cal_new (ESource *source, ECalSourceType type)
{
ECal *ecal;
@@ -1279,7 +1296,7 @@ e_cal_new (ESource *source, CalObjType type)
* not be constructed because it could not contact the calendar server.
**/
ECal *
-e_cal_new_from_uri (const gchar *uri, CalObjType type)
+e_cal_new_from_uri (const gchar *uri, ECalSourceType type)
{
ESourceGroup *group;
ESource *source;
@@ -2581,8 +2598,7 @@ compare_comp_instance (gconstpointer a, gconstpointer b)
* it gets passed if it intends to keep it around.
**/
void
-e_cal_generate_instances (ECal *ecal, CalObjType type,
- time_t start, time_t end,
+e_cal_generate_instances (ECal *ecal, time_t start, time_t end,
ECalRecurInstanceFn cb, gpointer cb_data)
{
ECalPrivate *priv;
diff --git a/calendar/libecal/e-cal.h b/calendar/libecal/e-cal.h
index 6614e38e0..77ba3514c 100644
--- a/calendar/libecal/e-cal.h
+++ b/calendar/libecal/e-cal.h
@@ -45,6 +45,13 @@ typedef struct _ECal ECal;
typedef struct _ECalClass ECalClass;
typedef struct _ECalPrivate ECalPrivate;
+typedef enum {
+ E_CAL_SOURCE_TYPE_EVENT,
+ E_CAL_SOURCE_TYPE_TODO,
+ E_CAL_SOURCE_TYPE_JOURNAL,
+ E_CAL_SOURCE_TYPE_LAST
+} ECalSourceType;
+
/* Set mode status for the e_cal_set_mode function */
typedef enum {
E_CAL_SET_MODE_SUCCESS,
@@ -93,8 +100,8 @@ GType e_cal_open_status_enum_get_type (void);
GType e_cal_set_mode_status_enum_get_type (void);
GType cal_mode_enum_get_type (void);
-ECal *e_cal_new (ESource *source, CalObjType type);
-ECal *e_cal_new_from_uri (const gchar *uri, CalObjType type);
+ECal *e_cal_new (ESource *source, ECalSourceType type);
+ECal *e_cal_new_from_uri (const gchar *uri, ECalSourceType type);
void e_cal_set_auth_func (ECal *ecal, ECalAuthFunc func, gpointer data);
@@ -140,8 +147,7 @@ void e_cal_free_object_list (GList *objects);
gboolean e_cal_get_free_busy (ECal *ecal, GList *users, time_t start, time_t end,
GList **freebusy, GError **error);
-void e_cal_generate_instances (ECal *ecal, CalObjType type,
- time_t start, time_t end,
+void e_cal_generate_instances (ECal *ecal, time_t start, time_t end,
ECalRecurInstanceFn cb, gpointer cb_data);
GSList *e_cal_get_alarms_in_range (ECal *ecal, time_t start, time_t end);