aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/conduit
diff options
context:
space:
mode:
authorJP Rosevear <jpr@helixcode.com>2000-12-08 08:14:42 +0800
committerJP Rosevear <jpr@src.gnome.org>2000-12-08 08:14:42 +0800
commit0a022753895f05235cbcddef223923a15b0d4b4f (patch)
tree87d809dac94748dc7e69657d9d0de68418874999 /addressbook/conduit
parent4a74b1ff15ca5cbc175c8fb98839960f1af494fb (diff)
downloadgsoc2013-evolution-0a022753895f05235cbcddef223923a15b0d4b4f.tar
gsoc2013-evolution-0a022753895f05235cbcddef223923a15b0d4b4f.tar.gz
gsoc2013-evolution-0a022753895f05235cbcddef223923a15b0d4b4f.tar.bz2
gsoc2013-evolution-0a022753895f05235cbcddef223923a15b0d4b4f.tar.lz
gsoc2013-evolution-0a022753895f05235cbcddef223923a15b0d4b4f.tar.xz
gsoc2013-evolution-0a022753895f05235cbcddef223923a15b0d4b4f.tar.zst
gsoc2013-evolution-0a022753895f05235cbcddef223923a15b0d4b4f.zip
Pass "" rather than NULL to e_card_new. (local_record_from_ecard): Make
2000-12-07 JP Rosevear <jpr@helixcode.com> * conduit/address-conduit.c (local_record_from_uid): Pass "" rather than NULL to e_card_new. (local_record_from_ecard): Make sure ecard->name is valid (check_for_slow_setting): Remove hard coded test value (card_added): g_strdup the resul of e_card_get_id (card_changed): ditto svn path=/trunk/; revision=6859
Diffstat (limited to 'addressbook/conduit')
-rw-r--r--addressbook/conduit/address-conduit.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c
index 8237c7da4c..4b7d85c0f2 100644
--- a/addressbook/conduit/address-conduit.c
+++ b/addressbook/conduit/address-conduit.c
@@ -302,14 +302,16 @@ local_record_from_ecard (EAddrLocalRecord *local, ECard *ecard, EAddrConduitCont
local->addr = g_new0 (struct Address, 1);
- if (ecard->name->given)
- local->addr->entry[entryFirstname] = strdup (ecard->name->given);
- if (ecard->name->family)
- local->addr->entry[entryLastname] = strdup (ecard->name->family);
- if (ecard->org)
- local->addr->entry[entryCompany] = strdup (ecard->org);
- if (ecard->title)
- local->addr->entry[entryTitle] = strdup (ecard->title);
+ if (ecard->name) {
+ if (ecard->name->given)
+ local->addr->entry[entryFirstname] = strdup (ecard->name->given);
+ if (ecard->name->family)
+ local->addr->entry[entryLastname] = strdup (ecard->name->family);
+ if (ecard->org)
+ local->addr->entry[entryCompany] = strdup (ecard->org);
+ if (ecard->title)
+ local->addr->entry[entryTitle] = strdup (ecard->title);
+ }
delivery = e_card_simple_get_delivery_address (simple, E_CARD_SIMPLE_ADDRESS_ID_HOME);
if (delivery) {
@@ -366,7 +368,7 @@ local_record_from_uid (EAddrLocalRecord *local,
if (ecard != NULL) {
local_record_from_ecard (local, ecard, ctxt);
} else {
- ecard = e_card_new (NULL);
+ ecard = e_card_new ("");
local_record_from_ecard (local, ecard, ctxt);
}
}
@@ -469,7 +471,6 @@ check_for_slow_setting (GnomePilotConduit *c, EAddrConduitContext *ctxt)
int count, map_count;
count = g_list_length (ctxt->cards);
- count = 0;
map_count = g_hash_table_size (ctxt->map->pid_map);
@@ -493,7 +494,7 @@ card_added (EBookView *book_view, const GList *cards, EAddrConduitContext *ctxt)
ECard *card = l->data;
CardObjectChange *coc = g_new0 (CardObjectChange, 1);
- coc->uid = e_card_get_id (card);
+ coc->uid = g_strdup (e_card_get_id (card));
coc->type = CARD_ADDED;
ctxt->changed = g_list_prepend (ctxt->changed, coc);
@@ -510,9 +511,9 @@ card_changed (EBookView *book_view, const GList *cards, EAddrConduitContext *ctx
ECard *card = l->data;
CardObjectChange *coc = g_new0 (CardObjectChange, 1);
- coc->uid = e_card_get_id (card);
+ coc->uid = g_strdup (e_card_get_id (card));
coc->type = CARD_MODIFIED;
-
+ g_print ("UID **** %s\n", coc->uid);
ctxt->changed = g_list_prepend (ctxt->changed, coc);
g_hash_table_insert (ctxt->changed_hash, coc->uid, coc);
}