aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-09-27 13:06:41 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-09-27 13:06:41 +0800
commit9158afb85e4551cd2032e490bade03fbef49994e (patch)
tree7eb6673aabfce5d396c49e9b4c915c07e5f62713
parentb235a79effc13b17b0bffc78189b831493bd37d6 (diff)
downloadgsoc2013-evolution-9158afb85e4551cd2032e490bade03fbef49994e.tar
gsoc2013-evolution-9158afb85e4551cd2032e490bade03fbef49994e.tar.gz
gsoc2013-evolution-9158afb85e4551cd2032e490bade03fbef49994e.tar.bz2
gsoc2013-evolution-9158afb85e4551cd2032e490bade03fbef49994e.tar.lz
gsoc2013-evolution-9158afb85e4551cd2032e490bade03fbef49994e.tar.xz
gsoc2013-evolution-9158afb85e4551cd2032e490bade03fbef49994e.tar.zst
gsoc2013-evolution-9158afb85e4551cd2032e490bade03fbef49994e.zip
use the old record (if there was one) so as not to overwrite fields we
2001-09-27 JP Rosevear <jpr@ximian.com> * conduit/address-conduit.c (local_record_from_ecard): use the old record (if there was one) so as not to overwrite fields we don't sync (pre_sync): store the dbi in the context and don't make it object data svn path=/trunk/; revision=13187
-rw-r--r--addressbook/ChangeLog8
-rw-r--r--addressbook/conduit/address-conduit.c18
-rw-r--r--addressbook/conduit/address-conduit.h3
3 files changed, 24 insertions, 5 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 853d90d1c9..c353f20095 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,11 @@
+2001-09-27 JP Rosevear <jpr@ximian.com>
+
+ * conduit/address-conduit.c (local_record_from_ecard): use the old
+ record (if there was one) so as not to overwrite fields we don't
+ sync
+ (pre_sync): store the dbi in the context and don't make it object
+ data
+
2001-09-26 Chris Toshok <toshok@ximian.com>
* backend/pas/pas-book-factory.c (pas_book_factory_destroy): use
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;
}
diff --git a/addressbook/conduit/address-conduit.h b/addressbook/conduit/address-conduit.h
index ea5fc12378..0b9cc5e551 100644
--- a/addressbook/conduit/address-conduit.h
+++ b/addressbook/conduit/address-conduit.h
@@ -54,7 +54,8 @@ struct _EAddrLocalRecord {
typedef struct _EAddrConduitContext EAddrConduitContext;
struct _EAddrConduitContext {
EAddrConduitCfg *cfg;
-
+ GnomePilotDBInfo *dbi;
+
struct AddressAppInfo ai;
EBook *ebook;