aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Heyn Olsen <eskil@src.gnome.org>1999-11-30 08:26:02 +0800
committerEskil Heyn Olsen <eskil@src.gnome.org>1999-11-30 08:26:02 +0800
commit6e69c396983498a6ff78a33928ad5fec98c8513f (patch)
treee259359636bef807e9109e5ddee6567ae0bb7aba
parent66031f68f0b4dc14d6db5f2a325482c0fdc1c156 (diff)
downloadgsoc2013-evolution-6e69c396983498a6ff78a33928ad5fec98c8513f.tar
gsoc2013-evolution-6e69c396983498a6ff78a33928ad5fec98c8513f.tar.gz
gsoc2013-evolution-6e69c396983498a6ff78a33928ad5fec98c8513f.tar.bz2
gsoc2013-evolution-6e69c396983498a6ff78a33928ad5fec98c8513f.tar.lz
gsoc2013-evolution-6e69c396983498a6ff78a33928ad5fec98c8513f.tar.xz
gsoc2013-evolution-6e69c396983498a6ff78a33928ad5fec98c8513f.tar.zst
gsoc2013-evolution-6e69c396983498a6ff78a33928ad5fec98c8513f.zip
Fixed compare bug. Also neated up some of the if's in set_status.
* calendar-conduit.c (compare): Fixed compare bug. Also neated up some of the if's in set_status. svn path=/trunk/; revision=1444
-rw-r--r--calendar/ChangeLog5
-rw-r--r--calendar/calendar-conduit.c24
-rw-r--r--calendar/conduits/calendar/calendar-conduit.c24
-rw-r--r--calendar/gui/calendar-conduit.c24
4 files changed, 44 insertions, 33 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 1ef22b9ebb..8b4bc937ab 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,8 @@
+1999-11-30 Eskil Heyn Olsen <deity@eskil.dk>
+
+ * calendar-conduit.c (compare): Fixed compare bug. Also neated up
+ some of the if's in set_status.
+
1999-11-22 Russell Steinthal <rms39@columbia.edu>
* Merged todo list coloring patch from stable
diff --git a/calendar/calendar-conduit.c b/calendar/calendar-conduit.c
index e8157e7826..5b8aaee40f 100644
--- a/calendar/calendar-conduit.c
+++ b/calendar/calendar-conduit.c
@@ -43,13 +43,14 @@ GnomePilotConduit * conduit_get_gpilot_conduit (guint32);
void conduit_destroy_gpilot_conduit (GnomePilotConduit*);
void local_record_from_icalobject(GCalLocalRecord *local,iCalObject *obj);
-#define CONDUIT_VERSION "0.8.5"
+#define CONDUIT_VERSION "0.8.6"
#ifdef G_LOG_DOMAIN
#undef G_LOG_DOMAIN
#endif
#define G_LOG_DOMAIN "gcalconduit"
#define DEBUG_CALCONDUIT
+/* #undef DEBUG_CALCONDUIT */
#ifdef DEBUG_CALCONDUIT
#define show_exception(e) g_warning ("Exception: %s\n", CORBA_exception_id (e))
@@ -819,7 +820,7 @@ set_status (GnomePilotConduitStandardAbs *conduit,
gint status,
GCalConduitContext *ctxt)
{
- LOG ("entering set_status");
+ LOG ("entering set_status(status=%d)",status);
g_return_val_if_fail(local!=NULL,-1);
@@ -839,14 +840,15 @@ set_status (GnomePilotConduitStandardAbs *conduit,
break;
}
- if ( status != GnomePilotRecordDeleted)
+ if ( status == GnomePilotRecordDeleted) {
+ GNOME_Calendar_Repository_delete_object(ctxt->calendar,local->ical->uid,&(ctxt->ev));
+ } else {
GNOME_Calendar_Repository_update_pilot_id(ctxt->calendar,
local->ical->uid,
local->local.ID,
local->ical->pilot_status,
&(ctxt->ev));
- else
- GNOME_Calendar_Repository_delete_object(ctxt->calendar,local->ical->uid,&(ctxt->ev));
+ }
if (ctxt->ev._major == CORBA_USER_EXCEPTION){
LOG ("Object did not exist");
@@ -1079,6 +1081,7 @@ compare (GnomePilotConduitStandardAbs *conduit,
/* used by the quick compare */
PilotRecord *remoteOfLocal;
int err;
+ int retval;
/* used by the tedious compare */
struct Appointment a;
@@ -1092,20 +1095,19 @@ compare (GnomePilotConduitStandardAbs *conduit,
err = transmit(conduit,local,&remoteOfLocal,ctxt);
if (err != 0) return err;
+ retval = 0;
if (remote->length == remoteOfLocal->length) {
- if (memcmp(remoteOfLocal,remote,remote->length)!=0) {
+ if (memcmp(remoteOfLocal->record,remote->record,remote->length)!=0) {
g_message("compare failed on contents");
- free_transmit(conduit,local,&remoteOfLocal,ctxt);
- return 1;
+ retval = 1;
}
} else {
g_message("compare failed on length");
- free_transmit(conduit,local,&remoteOfLocal,ctxt);
- return 1;
+ retval = 1;
}
free_transmit(conduit,local,&remoteOfLocal,ctxt);
- return 0;
+ return retval;
#else
/** FIXME: All the { LOG("yadayada"); return 1; } bloat is for debug purposes.
diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c
index e8157e7826..5b8aaee40f 100644
--- a/calendar/conduits/calendar/calendar-conduit.c
+++ b/calendar/conduits/calendar/calendar-conduit.c
@@ -43,13 +43,14 @@ GnomePilotConduit * conduit_get_gpilot_conduit (guint32);
void conduit_destroy_gpilot_conduit (GnomePilotConduit*);
void local_record_from_icalobject(GCalLocalRecord *local,iCalObject *obj);
-#define CONDUIT_VERSION "0.8.5"
+#define CONDUIT_VERSION "0.8.6"
#ifdef G_LOG_DOMAIN
#undef G_LOG_DOMAIN
#endif
#define G_LOG_DOMAIN "gcalconduit"
#define DEBUG_CALCONDUIT
+/* #undef DEBUG_CALCONDUIT */
#ifdef DEBUG_CALCONDUIT
#define show_exception(e) g_warning ("Exception: %s\n", CORBA_exception_id (e))
@@ -819,7 +820,7 @@ set_status (GnomePilotConduitStandardAbs *conduit,
gint status,
GCalConduitContext *ctxt)
{
- LOG ("entering set_status");
+ LOG ("entering set_status(status=%d)",status);
g_return_val_if_fail(local!=NULL,-1);
@@ -839,14 +840,15 @@ set_status (GnomePilotConduitStandardAbs *conduit,
break;
}
- if ( status != GnomePilotRecordDeleted)
+ if ( status == GnomePilotRecordDeleted) {
+ GNOME_Calendar_Repository_delete_object(ctxt->calendar,local->ical->uid,&(ctxt->ev));
+ } else {
GNOME_Calendar_Repository_update_pilot_id(ctxt->calendar,
local->ical->uid,
local->local.ID,
local->ical->pilot_status,
&(ctxt->ev));
- else
- GNOME_Calendar_Repository_delete_object(ctxt->calendar,local->ical->uid,&(ctxt->ev));
+ }
if (ctxt->ev._major == CORBA_USER_EXCEPTION){
LOG ("Object did not exist");
@@ -1079,6 +1081,7 @@ compare (GnomePilotConduitStandardAbs *conduit,
/* used by the quick compare */
PilotRecord *remoteOfLocal;
int err;
+ int retval;
/* used by the tedious compare */
struct Appointment a;
@@ -1092,20 +1095,19 @@ compare (GnomePilotConduitStandardAbs *conduit,
err = transmit(conduit,local,&remoteOfLocal,ctxt);
if (err != 0) return err;
+ retval = 0;
if (remote->length == remoteOfLocal->length) {
- if (memcmp(remoteOfLocal,remote,remote->length)!=0) {
+ if (memcmp(remoteOfLocal->record,remote->record,remote->length)!=0) {
g_message("compare failed on contents");
- free_transmit(conduit,local,&remoteOfLocal,ctxt);
- return 1;
+ retval = 1;
}
} else {
g_message("compare failed on length");
- free_transmit(conduit,local,&remoteOfLocal,ctxt);
- return 1;
+ retval = 1;
}
free_transmit(conduit,local,&remoteOfLocal,ctxt);
- return 0;
+ return retval;
#else
/** FIXME: All the { LOG("yadayada"); return 1; } bloat is for debug purposes.
diff --git a/calendar/gui/calendar-conduit.c b/calendar/gui/calendar-conduit.c
index e8157e7826..5b8aaee40f 100644
--- a/calendar/gui/calendar-conduit.c
+++ b/calendar/gui/calendar-conduit.c
@@ -43,13 +43,14 @@ GnomePilotConduit * conduit_get_gpilot_conduit (guint32);
void conduit_destroy_gpilot_conduit (GnomePilotConduit*);
void local_record_from_icalobject(GCalLocalRecord *local,iCalObject *obj);
-#define CONDUIT_VERSION "0.8.5"
+#define CONDUIT_VERSION "0.8.6"
#ifdef G_LOG_DOMAIN
#undef G_LOG_DOMAIN
#endif
#define G_LOG_DOMAIN "gcalconduit"
#define DEBUG_CALCONDUIT
+/* #undef DEBUG_CALCONDUIT */
#ifdef DEBUG_CALCONDUIT
#define show_exception(e) g_warning ("Exception: %s\n", CORBA_exception_id (e))
@@ -819,7 +820,7 @@ set_status (GnomePilotConduitStandardAbs *conduit,
gint status,
GCalConduitContext *ctxt)
{
- LOG ("entering set_status");
+ LOG ("entering set_status(status=%d)",status);
g_return_val_if_fail(local!=NULL,-1);
@@ -839,14 +840,15 @@ set_status (GnomePilotConduitStandardAbs *conduit,
break;
}
- if ( status != GnomePilotRecordDeleted)
+ if ( status == GnomePilotRecordDeleted) {
+ GNOME_Calendar_Repository_delete_object(ctxt->calendar,local->ical->uid,&(ctxt->ev));
+ } else {
GNOME_Calendar_Repository_update_pilot_id(ctxt->calendar,
local->ical->uid,
local->local.ID,
local->ical->pilot_status,
&(ctxt->ev));
- else
- GNOME_Calendar_Repository_delete_object(ctxt->calendar,local->ical->uid,&(ctxt->ev));
+ }
if (ctxt->ev._major == CORBA_USER_EXCEPTION){
LOG ("Object did not exist");
@@ -1079,6 +1081,7 @@ compare (GnomePilotConduitStandardAbs *conduit,
/* used by the quick compare */
PilotRecord *remoteOfLocal;
int err;
+ int retval;
/* used by the tedious compare */
struct Appointment a;
@@ -1092,20 +1095,19 @@ compare (GnomePilotConduitStandardAbs *conduit,
err = transmit(conduit,local,&remoteOfLocal,ctxt);
if (err != 0) return err;
+ retval = 0;
if (remote->length == remoteOfLocal->length) {
- if (memcmp(remoteOfLocal,remote,remote->length)!=0) {
+ if (memcmp(remoteOfLocal->record,remote->record,remote->length)!=0) {
g_message("compare failed on contents");
- free_transmit(conduit,local,&remoteOfLocal,ctxt);
- return 1;
+ retval = 1;
}
} else {
g_message("compare failed on length");
- free_transmit(conduit,local,&remoteOfLocal,ctxt);
- return 1;
+ retval = 1;
}
free_transmit(conduit,local,&remoteOfLocal,ctxt);
- return 0;
+ return retval;
#else
/** FIXME: All the { LOG("yadayada"); return 1; } bloat is for debug purposes.