From 7c0d72183dbe654feaaf146435816b4aaf58eebf Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 3 Jun 2004 20:05:32 +0000 Subject: Protect against a NULL uid. Fixes bug #57619. (ecard_from_remote_record): 2004-06-03 Jeffrey Stedfast * conduit/address-conduit.c (set_status_cleared): Protect against a NULL uid. Fixes bug #57619. (ecard_from_remote_record): Set the full_name of the contact so that we can use that as the FILE_AS rather than the company name, which sucked. Fixes a bug I may or may not have reported months ago. svn path=/trunk/; revision=26202 --- addressbook/conduit/address-conduit.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'addressbook/conduit') diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c index 9e29167590..bb10015419 100644 --- a/addressbook/conduit/address-conduit.c +++ b/addressbook/conduit/address-conduit.c @@ -981,9 +981,10 @@ ecard_from_remote_record(EAddrConduitContext *ctxt, EContactName *name; EContactAddress *eaddress; EContactField mailing_address; - char *txt, *find; + char *txt, *find, *full_name; EContactField next_mail, next_home, next_work, next_fax; EContactField next_other, next_main, next_pager, next_mobile; + const char *file_as; int i; g_return_val_if_fail(remote!=NULL,NULL); @@ -999,14 +1000,17 @@ ecard_from_remote_record(EAddrConduitContext *ctxt, name = e_contact_name_new (); name->given = get_entry_text (address, entryFirstname); name->family = get_entry_text (address, entryLastname); - - e_contact_set (contact, E_CONTACT_NAME, name); + + full_name = e_contact_name_to_string (name); + e_contact_set (contact, E_CONTACT_FULL_NAME, full_name); e_contact_name_free (name); + g_free (full_name); - /* File as */ - if (!e_contact_get_const (contact, E_CONTACT_FULL_NAME)) + /* File As */ + file_as = e_contact_get_const (contact, E_CONTACT_FILE_AS); + if (!file_as || *file_as == '\0') set_contact_text (contact, E_CONTACT_FILE_AS, address, entryCompany); - + /* Title and Company */ set_contact_text (contact, E_CONTACT_TITLE, address, entryTitle); set_contact_text (contact, E_CONTACT_ORG, address, entryCompany); -- cgit