From 332bf4c43050bcad778671cc968043ef0a51f83a Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Thu, 23 Sep 2004 18:50:17 +0000 Subject: only set the file as address to the company if no full name exists 2004-09-23 JP Rosevear * conduit/address-conduit.c (ecard_from_remote_record): only set the file as address to the company if no full name exists (delete_record): don't bail out if the record simply isn't found Fixes #59725 * conduit/address-conduit.c (local_record_from_uid): remove extraneous semicolon svn path=/trunk/; revision=27344 --- addressbook/ChangeLog | 11 +++++++++++ addressbook/conduit/address-conduit.c | 12 ++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 191c5866f0..e5a290c674 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,14 @@ +2004-09-23 JP Rosevear + + * conduit/address-conduit.c (ecard_from_remote_record): only set + the file as address to the company if no full name exists + (delete_record): don't bail out if the record simply isn't found + + Fixes #59725 + + * conduit/address-conduit.c (local_record_from_uid): remove + extraneous semicolon + 2004-09-21 William Jon McCann * gui/component/component-factory.c (factory): Quiet debug messages. diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c index a80b1e2b67..15573c190b 100644 --- a/addressbook/conduit/address-conduit.c +++ b/addressbook/conduit/address-conduit.c @@ -982,7 +982,7 @@ local_record_from_uid (EAddrLocalRecord *local, contact = l->data; /* FIXME Do we need to check for the empty string? */ - if ((cuid = e_contact_get_const (contact, E_CONTACT_UID)) && !strcmp (cuid, uid)); + if ((cuid = e_contact_get_const (contact, E_CONTACT_UID)) && !strcmp (cuid, uid)) break; contact = NULL; @@ -1030,11 +1030,13 @@ ecard_from_remote_record(EAddrConduitContext *ctxt, 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 */ - set_contact_text (contact, E_CONTACT_FILE_AS, address, entryCompany); + if (!full_name || !*full_name) + set_contact_text (contact, E_CONTACT_FILE_AS, address, entryCompany); + g_free (full_name); + /* Title and Company */ set_contact_text (contact, E_CONTACT_TITLE, address, entryTitle); set_contact_text (contact, E_CONTACT_ORG, address, entryCompany); @@ -1549,6 +1551,7 @@ delete_record (GnomePilotConduitSyncAbs *conduit, EAddrLocalRecord *local, EAddrConduitContext *ctxt) { + GError *error = NULL; int retval = 0; g_return_val_if_fail (local != NULL, -1); @@ -1557,8 +1560,9 @@ delete_record (GnomePilotConduitSyncAbs *conduit, LOG (g_message ( "delete_record: delete %s\n", print_local (local) )); e_pilot_map_remove_by_uid (ctxt->map, e_contact_get_const (local->contact, E_CONTACT_UID)); - if (!e_book_remove_contact (ctxt->ebook, e_contact_get_const (local->contact, E_CONTACT_UID), NULL)) { + if (!e_book_remove_contact (ctxt->ebook, e_contact_get_const (local->contact, E_CONTACT_UID), &error) && error->code != E_BOOK_ERROR_CONTACT_NOT_FOUND) { WARN ("delete_record: failed to delete card in ebook\n"); + g_error_free (error); retval = -1; } -- cgit v1.2.3