aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorJP Rosevear <jpr@helixcode.com>2000-09-21 12:12:02 +0800
committerJP Rosevear <jpr@src.gnome.org>2000-09-21 12:12:02 +0800
commit9e6e29ee3ce7bb0f757d17fa02f44edc99ca592b (patch)
tree6a453624b8c3f6f40c389ebc8b2bc0f2a619f5af /calendar
parent7239e19eaa67ee28c4ac19cb8422e0efa6d63856 (diff)
downloadgsoc2013-evolution-9e6e29ee3ce7bb0f757d17fa02f44edc99ca592b.tar
gsoc2013-evolution-9e6e29ee3ce7bb0f757d17fa02f44edc99ca592b.tar.gz
gsoc2013-evolution-9e6e29ee3ce7bb0f757d17fa02f44edc99ca592b.tar.bz2
gsoc2013-evolution-9e6e29ee3ce7bb0f757d17fa02f44edc99ca592b.tar.lz
gsoc2013-evolution-9e6e29ee3ce7bb0f757d17fa02f44edc99ca592b.tar.xz
gsoc2013-evolution-9e6e29ee3ce7bb0f757d17fa02f44edc99ca592b.tar.zst
gsoc2013-evolution-9e6e29ee3ce7bb0f757d17fa02f44edc99ca592b.zip
Don't fail if there is no map file.
2000-09-20 JP Rosevear <jpr@helixcode.com> * conduits/todo/todo-conduit.c (pre_sync): Don't fail if there is no map file. svn path=/trunk/; revision=5532
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog5
-rw-r--r--calendar/conduits/todo/todo-conduit.c22
2 files changed, 20 insertions, 7 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index dca894dfc4..a62a368745 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,10 @@
2000-09-20 JP Rosevear <jpr@helixcode.com>
+ * conduits/todo/todo-conduit.c (pre_sync): Don't fail if there
+ is no map file.
+
+2000-09-20 JP Rosevear <jpr@helixcode.com>
+
* conduits/todo/todo-conduit.h: Add since field to context
* conduits/todo/todo-conduit.c (map_set_node_timet): New utility
diff --git a/calendar/conduits/todo/todo-conduit.c b/calendar/conduits/todo/todo-conduit.c
index 61bf8f9cab..4253000598 100644
--- a/calendar/conduits/todo/todo-conduit.c
+++ b/calendar/conduits/todo/todo-conduit.c
@@ -88,6 +88,8 @@ static char *print_local (EToDoLocalRecord *local)
return buff;
}
+ return "";
+
return cal_component_get_as_string (local->comp);
}
@@ -486,8 +488,8 @@ comp_from_remote_record (GnomePilotConduitStandardAbs *conduit,
comp = cal_component_clone (in_comp);
}
- LOG (" comp_from_remote_record: "
- "merging remote %s into local %s\n",
+ LOG (" comp_from_remote_record: "
+ "merging remote %s into local %s\n",
print_remote (remote), cal_component_get_as_string (comp));
cal_component_set_last_modified (comp, &now);
@@ -604,12 +606,15 @@ pre_sync (GnomePilotConduit *conduit,
/* Load the uid <--> pilot id mapping */
ctxt->map = g_hash_table_new (g_int_hash, g_int_equal);
- memset (&handler, 0, sizeof (xmlSAXHandler));
- handler.startElement = map_sax_start_element;
filename = map_name (ctxt);
- if (xmlSAXUserParseFile (&handler, ctxt, filename) < 0)
- return -1;
+ if (g_file_exists (filename)) {
+ memset (&handler, 0, sizeof (xmlSAXHandler));
+ handler.startElement = map_sax_start_element;
+
+ if (xmlSAXUserParseFile (&handler, ctxt, filename) < 0)
+ return -1;
+ }
g_free (filename);
@@ -689,11 +694,12 @@ update_record (GnomePilotConduitStandardAbs *conduit,
status = CAL_CLIENT_LOAD_ERROR;
if (status != CAL_CLIENT_GET_SUCCESS) {
+ LOG (" new record being created\n");
comp = comp_from_remote_record (conduit, remote, NULL);
} else {
CalComponent *new_comp;
- LOG ("succeeded %s\n", cal_component_get_as_string (comp));
+ LOG (" record found\n");
new_comp = comp_from_remote_record (conduit, remote, comp);
gtk_object_unref (GTK_OBJECT (comp));
@@ -735,6 +741,8 @@ match_record (GnomePilotConduitStandardAbs *conduit,
if (!uid)
return -1;
+ LOG (" matched\n");
+
*local = g_new0 (EToDoLocalRecord, 1);
local_record_from_uid (*local, uid, ctxt);