aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/conduits/todo
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-09-29 05:22:43 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-09-29 05:22:43 +0800
commit564c06f69d3de76e62687137306316de4ee09a87 (patch)
tree57ff5a1d0e57cae24f2afa04a1d0431cfced7e5b /calendar/conduits/todo
parent8f338e40f91fcdf430b29ea4b9ebcd3e384b0ff1 (diff)
downloadgsoc2013-evolution-564c06f69d3de76e62687137306316de4ee09a87.tar
gsoc2013-evolution-564c06f69d3de76e62687137306316de4ee09a87.tar.gz
gsoc2013-evolution-564c06f69d3de76e62687137306316de4ee09a87.tar.bz2
gsoc2013-evolution-564c06f69d3de76e62687137306316de4ee09a87.tar.lz
gsoc2013-evolution-564c06f69d3de76e62687137306316de4ee09a87.tar.xz
gsoc2013-evolution-564c06f69d3de76e62687137306316de4ee09a87.tar.zst
gsoc2013-evolution-564c06f69d3de76e62687137306316de4ee09a87.zip
Handle the fields and category we don't sync by making sure we don't
2001-09-28 JP Rosevear <jpr@ximian.com> * conduits/calendar/calendar-conduit.c (local_record_from_comp): Handle the fields and category we don't sync by making sure we don't overwrite them (local_record_to_pilot_record): use local record category (pre_sync): track db info * conduits/calendar/calendar-conduit.h: db info field * conduits/todo/todo-conduit.[hc]: same as above svn path=/trunk/; revision=13235
Diffstat (limited to 'calendar/conduits/todo')
-rw-r--r--calendar/conduits/todo/todo-conduit.c28
-rw-r--r--calendar/conduits/todo/todo-conduit.h3
2 files changed, 24 insertions, 7 deletions
diff --git a/calendar/conduits/todo/todo-conduit.c b/calendar/conduits/todo/todo-conduit.c
index 05451ed754..c073b22eb0 100644
--- a/calendar/conduits/todo/todo-conduit.c
+++ b/calendar/conduits/todo/todo-conduit.c
@@ -339,7 +339,7 @@ local_record_to_pilot_record (EToDoLocalRecord *local,
LOG ("local_record_to_pilot_record\n");
p.ID = local->local.ID;
- p.category = 0;
+ p.category = local->local.category;
p.attr = local->local.attr;
p.archived = local->local.archived;
p.secret = local->local.secret;
@@ -382,6 +382,22 @@ local_record_from_comp (EToDoLocalRecord *local, CalComponent *comp, EToDoCondui
local->todo = g_new0 (struct ToDo,1);
+ /* Handle the fields and category we don't sync by making sure
+ * we don't overwrite them
+ */
+ if (local->local.ID != 0) {
+ char record[0xffff];
+ int cat = 0;
+
+ if (dlp_ReadRecordById (ctxt->dbi->pilot_socket,
+ ctxt->dbi->db_handle,
+ local->local.ID, &record,
+ NULL, NULL, NULL, &cat) > 0) {
+ local->local.category = cat;
+ unpack_ToDo (local->todo, record, 0xffff);
+ }
+ }
+
/* STOP: don't replace these with g_strdup, since free_ToDo
uses free to deallocate */
cal_component_get_summary (comp, &summary);
@@ -586,6 +602,7 @@ pre_sync (GnomePilotConduit *conduit,
LOG ("pre_sync: ToDo Conduit v.%s", CONDUIT_VERSION);
g_message ("ToDo Conduit v.%s", CONDUIT_VERSION);
+ ctxt->dbi = dbi;
ctxt->client = NULL;
if (start_calendar_server (ctxt) != 0) {
@@ -643,8 +660,6 @@ pre_sync (GnomePilotConduit *conduit,
gnome_pilot_conduit_sync_abs_set_num_updated_local_records (abs_conduit, mod_records);
gnome_pilot_conduit_sync_abs_set_num_deleted_local_records(abs_conduit, del_records);
- gtk_object_set_data (GTK_OBJECT (conduit), "dbinfo", dbi);
-
buf = (unsigned char*)g_malloc (0xffff);
len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0,
(unsigned char *)buf, 0xffff);
@@ -671,10 +686,9 @@ post_sync (GnomePilotConduit *conduit,
{
GList *changed;
gchar *filename, *change_id;
-
- LOG ("post_sync: ToDo Conduit v.%s", CONDUIT_VERSION);
- LOG ("---------------------------------------------------------\n");
+ LOG ("post_sync: ToDo Conduit v.%s", CONDUIT_VERSION);
+
filename = map_name (ctxt);
e_pilot_map_write (filename, ctxt->map);
g_free (filename);
@@ -686,6 +700,8 @@ post_sync (GnomePilotConduit *conduit,
changed = cal_client_get_changes (ctxt->client, CALOBJ_TYPE_TODO, change_id);
cal_client_change_list_free (changed);
+ LOG ("---------------------------------------------------------\n");
+
return 0;
}
diff --git a/calendar/conduits/todo/todo-conduit.h b/calendar/conduits/todo/todo-conduit.h
index e92ad7a9d5..8e365ce78f 100644
--- a/calendar/conduits/todo/todo-conduit.h
+++ b/calendar/conduits/todo/todo-conduit.h
@@ -56,7 +56,8 @@ struct _EToDoLocalRecord {
typedef struct _EToDoConduitContext EToDoConduitContext;
struct _EToDoConduitContext {
EToDoConduitCfg *cfg;
-
+ GnomePilotDBInfo *dbi;
+
struct ToDoAppInfo ai;
CalClient *client;