aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@novell.com>2004-06-04 04:05:32 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-06-04 04:05:32 +0800
commit7c0d72183dbe654feaaf146435816b4aaf58eebf (patch)
treefa775720acbeb9116c2bbdd4ba8d9d530444805f
parent3048b4c9decd91d7c5baa0a9ec29f98a91976f1a (diff)
downloadgsoc2013-evolution-7c0d72183dbe654feaaf146435816b4aaf58eebf.tar
gsoc2013-evolution-7c0d72183dbe654feaaf146435816b4aaf58eebf.tar.gz
gsoc2013-evolution-7c0d72183dbe654feaaf146435816b4aaf58eebf.tar.bz2
gsoc2013-evolution-7c0d72183dbe654feaaf146435816b4aaf58eebf.tar.lz
gsoc2013-evolution-7c0d72183dbe654feaaf146435816b4aaf58eebf.tar.xz
gsoc2013-evolution-7c0d72183dbe654feaaf146435816b4aaf58eebf.tar.zst
gsoc2013-evolution-7c0d72183dbe654feaaf146435816b4aaf58eebf.zip
Protect against a NULL uid. Fixes bug #57619. (ecard_from_remote_record):
2004-06-03 Jeffrey Stedfast <fejj@novell.com> * 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
-rw-r--r--addressbook/ChangeLog4
-rw-r--r--addressbook/conduit/address-conduit.c16
2 files changed, 14 insertions, 6 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index c32db78c6e..bfc048ccb6 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -2,6 +2,10 @@
* 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.
2004-06-02 Hans Petter Jansson <hpj@ximian.com>
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);