diff options
Diffstat (limited to 'addressbook/conduit/address-conduit.c')
-rw-r--r-- | addressbook/conduit/address-conduit.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c index 13fb05a3b4..ef78fc88d0 100644 --- a/addressbook/conduit/address-conduit.c +++ b/addressbook/conduit/address-conduit.c @@ -355,6 +355,17 @@ local_record_from_ecard (EAddrLocalRecord *local, ECard *ecard, EAddrConduitCont local->addr = g_new0 (struct Address, 1); + /* Handle the fields we don't sync by making sure we don't overwrite them */ + if (local->local.ID != 0) { + char record[0xffff]; + + if (dlp_ReadRecordById (ctxt->dbi->pilot_socket, + ctxt->dbi->db_handle, + local->local.ID, &record, + NULL, NULL, NULL, NULL) > 0) + unpack_Address (local->addr, record, 0xffff); + } + if (ecard->name) { if (ecard->name->given) local->addr->entry[entryFirstname] = e_pilot_utf8_to_pchar (ecard->name->given); @@ -708,6 +719,7 @@ pre_sync (GnomePilotConduit *conduit, LOG ("pre_sync: Addressbook Conduit v.%s", CONDUIT_VERSION); g_message ("Addressbook Conduit v.%s", CONDUIT_VERSION); + ctxt->dbi = dbi; ctxt->ebook = NULL; if (start_addressbook_server (ctxt) != 0) { @@ -737,8 +749,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); @@ -1115,9 +1125,9 @@ prepare (GnomePilotConduitSyncAbs *conduit, EAddrConduitContext *ctxt) { LOG ("prepare: encoding local %s\n", print_local (local)); - + *remote = local_record_to_pilot_record (local, ctxt); - + return 0; } |