aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Heyn Olsen <eskil@src.gnome.org>1999-09-19 17:35:41 +0800
committerEskil Heyn Olsen <eskil@src.gnome.org>1999-09-19 17:35:41 +0800
commit0c7bf54679b4173947c8caf94a88b46196be5d6d (patch)
tree9b32190059b0dad037ec084f668dc9446022f800
parentf75cc7238b336522d966538e58f79bb11b996cbc (diff)
downloadgsoc2013-evolution-0c7bf54679b4173947c8caf94a88b46196be5d6d.tar.gz
gsoc2013-evolution-0c7bf54679b4173947c8caf94a88b46196be5d6d.tar.zst
gsoc2013-evolution-0c7bf54679b4173947c8caf94a88b46196be5d6d.zip
About to rehash conduit.
Changed pilotid in calobj to guint32. svn path=/trunk/; revision=1240
-rw-r--r--calendar/cal-util/calobj.h2
-rw-r--r--calendar/calendar-conduit.c42
-rw-r--r--calendar/calobj.h2
-rw-r--r--calendar/conduits/calendar/calendar-conduit.c42
-rw-r--r--calendar/gui/calendar-conduit.c42
-rw-r--r--calendar/pcs/calobj.h2
6 files changed, 117 insertions, 15 deletions
diff --git a/calendar/cal-util/calobj.h b/calendar/cal-util/calobj.h
index 8be38e5d26..fbc92a41c5 100644
--- a/calendar/cal-util/calobj.h
+++ b/calendar/cal-util/calobj.h
@@ -181,7 +181,7 @@ typedef struct {
/* Pilot */
iCalPilotState pilot_status; /* Status information */
- int pilot_id; /* Pilot ID */
+ guint32 pilot_id; /* Pilot ID */
} iCalObject;
/* The callback for the recurrence generator */
diff --git a/calendar/calendar-conduit.c b/calendar/calendar-conduit.c
index c931b15174..929527264f 100644
--- a/calendar/calendar-conduit.c
+++ b/calendar/calendar-conduit.c
@@ -81,7 +81,7 @@ local_from_ical(CalLocalRecord **local,iCalObject *obj) {
g_message("(*local)->Id = %ld",(*local)->ID);
switch((*local)->ical->pilot_status) {
case ICAL_PILOT_SYNC_NONE: (*local)->local.attr = RecordNothing; break;
- case ICAL_PILOT_SYNC_MOD: (*local)->local.attr = RecordNew; break;
+ case ICAL_PILOT_SYNC_MOD: (*local)->local.attr = RecordNew|RecordModified; break;
case ICAL_PILOT_SYNC_DEL: (*local)->local.attr = RecordDeleted; break;
}
@@ -180,11 +180,13 @@ update_record (PilotRecord *remote)
obj = ical_object_new_from_string (vcal_string);
}
+ /*
if (obj->pilot_status == ICAL_PILOT_SYNC_MOD){
printf (_("\tObject has been modified on desktop and on the pilot, desktop takes precedence\n"));
ical_object_destroy (obj);
return;
}
+ */
/*
* Begin and end
@@ -500,7 +502,7 @@ iterate_specific (GnomePilotConduitStandardAbs *conduit,
gnome_pilot_conduit_standard_abs_iterate(conduit,(LocalRecord**)local);
if((*local)==NULL) break;
if(archived && ((*local)->local.archived==archived)) break;
- if((*local)->local.attr == flag) break;
+ if((*local)->local.attr |= flag) break;
} while((*local)!=NULL);
return 1;
@@ -510,8 +512,11 @@ static gint
purge (GnomePilotConduitStandardAbs *conduit,
gpointer data)
{
- g_print ("entering purge\n");
- return 1;
+ g_print ("entering purge\n");
+
+ /* HEST, gem posterne her */
+
+ return 1;
}
static gint
@@ -521,6 +526,23 @@ set_status (GnomePilotConduitStandardAbs *conduit,
gpointer data)
{
g_print ("entering set_status\n");
+ g_return_val_if_fail(local!=NULL,0);
+ g_assert(local->ical!=NULL);
+
+ local->local.attr = status;
+ switch(status) {
+ case RecordPending:
+ case RecordNothing:
+ local->ical->pilot_status = ICAL_PILOT_SYNC_NONE;
+ break;
+ case RecordDeleted:
+ local->ical->pilot_status = ICAL_PILOT_SYNC_DEL;
+ break;
+ case RecordNew:
+ case RecordModified:
+ local->ical->pilot_status = ICAL_PILOT_SYNC_MOD;
+ break;
+ }
return 0;
}
@@ -531,6 +553,13 @@ set_archived (GnomePilotConduitStandardAbs *conduit,
gpointer data)
{
g_print ("entering set_archived\n");
+ g_return_val_if_fail(local!=NULL,0);
+ g_assert(local->ical!=NULL);
+
+ local->local.archived = archived;
+ /* FIXME: This should move the entry into a speciel
+ calendar file, eg. Archive, or (by config option), simply
+ delete it */
return 1;
}
@@ -541,6 +570,11 @@ set_pilot_id (GnomePilotConduitStandardAbs *conduit,
gpointer data)
{
g_print ("entering set_pilot_id\n");
+ g_return_val_if_fail(local!=NULL,0);
+ g_assert(local->ical!=NULL);
+
+ local->ID = ID;
+ local->ical->pilot_id = ID;
return 1;
}
diff --git a/calendar/calobj.h b/calendar/calobj.h
index 8be38e5d26..fbc92a41c5 100644
--- a/calendar/calobj.h
+++ b/calendar/calobj.h
@@ -181,7 +181,7 @@ typedef struct {
/* Pilot */
iCalPilotState pilot_status; /* Status information */
- int pilot_id; /* Pilot ID */
+ guint32 pilot_id; /* Pilot ID */
} iCalObject;
/* The callback for the recurrence generator */
diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c
index c931b15174..929527264f 100644
--- a/calendar/conduits/calendar/calendar-conduit.c
+++ b/calendar/conduits/calendar/calendar-conduit.c
@@ -81,7 +81,7 @@ local_from_ical(CalLocalRecord **local,iCalObject *obj) {
g_message("(*local)->Id = %ld",(*local)->ID);
switch((*local)->ical->pilot_status) {
case ICAL_PILOT_SYNC_NONE: (*local)->local.attr = RecordNothing; break;
- case ICAL_PILOT_SYNC_MOD: (*local)->local.attr = RecordNew; break;
+ case ICAL_PILOT_SYNC_MOD: (*local)->local.attr = RecordNew|RecordModified; break;
case ICAL_PILOT_SYNC_DEL: (*local)->local.attr = RecordDeleted; break;
}
@@ -180,11 +180,13 @@ update_record (PilotRecord *remote)
obj = ical_object_new_from_string (vcal_string);
}
+ /*
if (obj->pilot_status == ICAL_PILOT_SYNC_MOD){
printf (_("\tObject has been modified on desktop and on the pilot, desktop takes precedence\n"));
ical_object_destroy (obj);
return;
}
+ */
/*
* Begin and end
@@ -500,7 +502,7 @@ iterate_specific (GnomePilotConduitStandardAbs *conduit,
gnome_pilot_conduit_standard_abs_iterate(conduit,(LocalRecord**)local);
if((*local)==NULL) break;
if(archived && ((*local)->local.archived==archived)) break;
- if((*local)->local.attr == flag) break;
+ if((*local)->local.attr |= flag) break;
} while((*local)!=NULL);
return 1;
@@ -510,8 +512,11 @@ static gint
purge (GnomePilotConduitStandardAbs *conduit,
gpointer data)
{
- g_print ("entering purge\n");
- return 1;
+ g_print ("entering purge\n");
+
+ /* HEST, gem posterne her */
+
+ return 1;
}
static gint
@@ -521,6 +526,23 @@ set_status (GnomePilotConduitStandardAbs *conduit,
gpointer data)
{
g_print ("entering set_status\n");
+ g_return_val_if_fail(local!=NULL,0);
+ g_assert(local->ical!=NULL);
+
+ local->local.attr = status;
+ switch(status) {
+ case RecordPending:
+ case RecordNothing:
+ local->ical->pilot_status = ICAL_PILOT_SYNC_NONE;
+ break;
+ case RecordDeleted:
+ local->ical->pilot_status = ICAL_PILOT_SYNC_DEL;
+ break;
+ case RecordNew:
+ case RecordModified:
+ local->ical->pilot_status = ICAL_PILOT_SYNC_MOD;
+ break;
+ }
return 0;
}
@@ -531,6 +553,13 @@ set_archived (GnomePilotConduitStandardAbs *conduit,
gpointer data)
{
g_print ("entering set_archived\n");
+ g_return_val_if_fail(local!=NULL,0);
+ g_assert(local->ical!=NULL);
+
+ local->local.archived = archived;
+ /* FIXME: This should move the entry into a speciel
+ calendar file, eg. Archive, or (by config option), simply
+ delete it */
return 1;
}
@@ -541,6 +570,11 @@ set_pilot_id (GnomePilotConduitStandardAbs *conduit,
gpointer data)
{
g_print ("entering set_pilot_id\n");
+ g_return_val_if_fail(local!=NULL,0);
+ g_assert(local->ical!=NULL);
+
+ local->ID = ID;
+ local->ical->pilot_id = ID;
return 1;
}
diff --git a/calendar/gui/calendar-conduit.c b/calendar/gui/calendar-conduit.c
index c931b15174..929527264f 100644
--- a/calendar/gui/calendar-conduit.c
+++ b/calendar/gui/calendar-conduit.c
@@ -81,7 +81,7 @@ local_from_ical(CalLocalRecord **local,iCalObject *obj) {
g_message("(*local)->Id = %ld",(*local)->ID);
switch((*local)->ical->pilot_status) {
case ICAL_PILOT_SYNC_NONE: (*local)->local.attr = RecordNothing; break;
- case ICAL_PILOT_SYNC_MOD: (*local)->local.attr = RecordNew; break;
+ case ICAL_PILOT_SYNC_MOD: (*local)->local.attr = RecordNew|RecordModified; break;
case ICAL_PILOT_SYNC_DEL: (*local)->local.attr = RecordDeleted; break;
}
@@ -180,11 +180,13 @@ update_record (PilotRecord *remote)
obj = ical_object_new_from_string (vcal_string);
}
+ /*
if (obj->pilot_status == ICAL_PILOT_SYNC_MOD){
printf (_("\tObject has been modified on desktop and on the pilot, desktop takes precedence\n"));
ical_object_destroy (obj);
return;
}
+ */
/*
* Begin and end
@@ -500,7 +502,7 @@ iterate_specific (GnomePilotConduitStandardAbs *conduit,
gnome_pilot_conduit_standard_abs_iterate(conduit,(LocalRecord**)local);
if((*local)==NULL) break;
if(archived && ((*local)->local.archived==archived)) break;
- if((*local)->local.attr == flag) break;
+ if((*local)->local.attr |= flag) break;
} while((*local)!=NULL);
return 1;
@@ -510,8 +512,11 @@ static gint
purge (GnomePilotConduitStandardAbs *conduit,
gpointer data)
{
- g_print ("entering purge\n");
- return 1;
+ g_print ("entering purge\n");
+
+ /* HEST, gem posterne her */
+
+ return 1;
}
static gint
@@ -521,6 +526,23 @@ set_status (GnomePilotConduitStandardAbs *conduit,
gpointer data)
{
g_print ("entering set_status\n");
+ g_return_val_if_fail(local!=NULL,0);
+ g_assert(local->ical!=NULL);
+
+ local->local.attr = status;
+ switch(status) {
+ case RecordPending:
+ case RecordNothing:
+ local->ical->pilot_status = ICAL_PILOT_SYNC_NONE;
+ break;
+ case RecordDeleted:
+ local->ical->pilot_status = ICAL_PILOT_SYNC_DEL;
+ break;
+ case RecordNew:
+ case RecordModified:
+ local->ical->pilot_status = ICAL_PILOT_SYNC_MOD;
+ break;
+ }
return 0;
}
@@ -531,6 +553,13 @@ set_archived (GnomePilotConduitStandardAbs *conduit,
gpointer data)
{
g_print ("entering set_archived\n");
+ g_return_val_if_fail(local!=NULL,0);
+ g_assert(local->ical!=NULL);
+
+ local->local.archived = archived;
+ /* FIXME: This should move the entry into a speciel
+ calendar file, eg. Archive, or (by config option), simply
+ delete it */
return 1;
}
@@ -541,6 +570,11 @@ set_pilot_id (GnomePilotConduitStandardAbs *conduit,
gpointer data)
{
g_print ("entering set_pilot_id\n");
+ g_return_val_if_fail(local!=NULL,0);
+ g_assert(local->ical!=NULL);
+
+ local->ID = ID;
+ local->ical->pilot_id = ID;
return 1;
}
diff --git a/calendar/pcs/calobj.h b/calendar/pcs/calobj.h
index 8be38e5d26..fbc92a41c5 100644
--- a/calendar/pcs/calobj.h
+++ b/calendar/pcs/calobj.h
@@ -181,7 +181,7 @@ typedef struct {
/* Pilot */
iCalPilotState pilot_status; /* Status information */
- int pilot_id; /* Pilot ID */
+ guint32 pilot_id; /* Pilot ID */
} iCalObject;
/* The callback for the recurrence generator */