From a66943ec821cda5eaef68ea8ecc07d3593dda893 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Sun, 23 Mar 2003 09:18:04 +0000 Subject: [ fixes bug #32113 ] add include_email arg to e_destination_get_textrep. 2003-03-23 Chris Toshok [ fixes bug #32113 ] * backend/ebook/e-destination.h: add include_email arg to e_destination_get_textrep. * backend/ebook/e-destination.c (e_destination_get_textrep): add include_email arg. if it's TRUE, and if there's an email address to add * gui/contact-list-editor/e-contact-list-model.c (contact_list_value_at): use e_destination_get_textrep so we don't display QP text, and pass TRUE for include_email. * gui/widgets/e-minicard.c (add_field): same. (remodel): same. * gui/widgets/e-addressbook-treeview-adapter.c (adapter_get_value): same. * gui/widgets/e-addressbook-table-adapter.c (addressbook_value_at): same. * gui/component/select-names/e-select-names-text-model.c (e_select_names_text_model_insert_length): pass FALSE for include_email. * gui/component/select-names/e-select-names-model.c (e_select_names_model_get_textification): pass FALSE for include_email. (e_select_names_model_get_string): same. (e_select_names_model_replace): same. (e_select_names_model_name_pos): same. (e_select_names_model_text_pos): same. svn path=/trunk/; revision=20467 --- addressbook/backend/ebook/e-destination.c | 12 ++++++------ addressbook/backend/ebook/e-destination.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'addressbook/backend') diff --git a/addressbook/backend/ebook/e-destination.c b/addressbook/backend/ebook/e-destination.c index 87c3d83ee3..a746fd9cf9 100644 --- a/addressbook/backend/ebook/e-destination.c +++ b/addressbook/backend/ebook/e-destination.c @@ -263,7 +263,7 @@ e_destination_clear_card (EDestination *dest) dest->priv->old_card_email_num = dest->priv->card_email_num; g_free (dest->priv->old_textrep); - dest->priv->old_textrep = g_strdup (e_destination_get_textrep (dest)); + dest->priv->old_textrep = g_strdup (e_destination_get_textrep (dest, FALSE)); } g_free (dest->priv->book_uri); @@ -837,7 +837,7 @@ e_destination_set_raw (EDestination *dest, const gchar *raw) } const gchar * -e_destination_get_textrep (const EDestination *dest) +e_destination_get_textrep (const EDestination *dest, gboolean include_email) { const char *name, *email; @@ -849,7 +849,7 @@ e_destination_get_textrep (const EDestination *dest) name = e_destination_get_name (dest); email = e_destination_get_email (dest); - if (e_destination_from_card (dest) && name != NULL) + if (e_destination_from_card (dest) && name != NULL && (!include_email || !email || !*email)) return name; /* Make sure that our address gets quoted properly */ @@ -1005,7 +1005,7 @@ nickname_simple_query_cb (EBook *book, EBookSimpleQueryStatus status, const GLis we do a name-only query on the textrep */ e_book_name_and_email_query (book, - e_destination_get_textrep (dest), + e_destination_get_textrep (dest, FALSE), NULL, name_and_email_simple_query_cb, dest); @@ -1022,7 +1022,7 @@ launch_cardify_query (EDestination *dest) if (! e_destination_is_valid (dest)) { /* If it doesn't look like an e-mail address, see if it is a nickname. */ e_book_nickname_query (dest->priv->cardify_book, - e_destination_get_textrep (dest), + e_destination_get_textrep (dest, FALSE), nickname_simple_query_cb, dest); @@ -1058,7 +1058,7 @@ e_destination_reverting_is_a_good_idea (EDestination *dest) if (dest->priv->old_textrep == NULL) return FALSE; - textrep = e_destination_get_textrep (dest); + textrep = e_destination_get_textrep (dest, FALSE); len = g_utf8_strlen (textrep, -1); old_len = g_utf8_strlen (dest->priv->old_textrep, -1); diff --git a/addressbook/backend/ebook/e-destination.h b/addressbook/backend/ebook/e-destination.h index eb8257fb12..acd6af1bc4 100644 --- a/addressbook/backend/ebook/e-destination.h +++ b/addressbook/backend/ebook/e-destination.h @@ -96,10 +96,10 @@ gint e_destination_get_email_num (const EDestination *); const gchar *e_destination_get_name (const EDestination *); /* "Jane Smith" */ const gchar *e_destination_get_email (const EDestination *); /* "jane@assbarn.com" */ -const gchar *e_destination_get_address (const EDestination *); /* "Jane Smith " (or a comma-sep set of such for a list) */ +const gchar *e_destination_get_address (const EDestination *);; /* "Jane Smith " (or a comma-sep set of such for a list) */ void e_destination_set_raw (EDestination *, const gchar *free_form_string); -const gchar *e_destination_get_textrep (const EDestination *); /* "Jane Smith" or "jane@assbarn.com" */ +const gchar *e_destination_get_textrep (const EDestination *, gboolean include_email); /* "Jane Smith" or "jane@assbarn.com" */ gboolean e_destination_is_evolution_list (const EDestination *); gboolean e_destination_list_show_addresses (const EDestination *); -- cgit v1.2.3