From 3c53644cb5136198ea77491ea31b35bd070e70da Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Tue, 24 Jul 2001 21:52:36 +0000 Subject: Added fallbacks for the name in the case of an e-card, to avoid the 2001-07-24 Jon Trowbridge * backend/ebook/e-destination.c (e_destination_get_name): Added fallbacks for the name in the case of an e-card, to avoid the "nameless contact" bug. svn path=/trunk/; revision=11358 --- addressbook/backend/ebook/e-destination.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'addressbook/backend') diff --git a/addressbook/backend/ebook/e-destination.c b/addressbook/backend/ebook/e-destination.c index f470769a2e..e836922ba3 100644 --- a/addressbook/backend/ebook/e-destination.c +++ b/addressbook/backend/ebook/e-destination.c @@ -394,8 +394,20 @@ e_destination_get_name (const EDestination *dest) priv = (struct _EDestinationPrivate *)dest->priv; /* cast out const */ - if (priv->name == NULL && priv->card != NULL) + if (priv->name == NULL && priv->card != NULL) { + priv->name = e_card_name_to_string (priv->card->name); + + if (priv->name == NULL || *priv->name == '\0') { + g_free (priv->name); + priv->name = g_strdup (priv->card->file_as); + } + + if (priv->name == NULL || *priv->name == '\0') { + g_free (priv->name); + priv->name = e_destination_get_email (dest); + } + } return priv->name; -- cgit v1.2.3