From d0e85041da6a3dfba45be023e0efc7e4662efefb Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 9 Jul 2001 20:16:20 +0000 Subject: Use camel_internet_address_format_address rather than camel_address_encode 2001-07-09 Jeffrey Stedfast * e-msg-composer.c (e_msg_composer_new_with_message): Use camel_internet_address_format_address rather than camel_address_encode since we want display-friendly addresses. svn path=/trunk/; revision=10930 --- composer/ChangeLog | 6 ++++++ composer/e-msg-composer-hdrs.c | 13 +++++++------ composer/e-msg-composer.c | 41 +++++++++++++---------------------------- 3 files changed, 26 insertions(+), 34 deletions(-) diff --git a/composer/ChangeLog b/composer/ChangeLog index 7fbb3380a9..81ba535b24 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,9 @@ +2001-07-09 Jeffrey Stedfast + + * e-msg-composer.c (e_msg_composer_new_with_message): Use + camel_internet_address_format_address rather than + camel_address_encode since we want display-friendly addresses. + 2001-07-09 Iain Holmes * e-msg-composer-select-file.c (file_selection_info_destroy_notify): diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c index e29f351fd5..9180cfd216 100644 --- a/composer/e-msg-composer-hdrs.c +++ b/composer/e-msg-composer-hdrs.c @@ -735,9 +735,9 @@ e_msg_composer_hdrs_set_from_account (EMsgComposerHdrs *hdrs, g_return_if_fail (hdrs != NULL); g_return_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs)); - + omenu = GTK_OPTION_MENU (hdrs->priv->from.entry); - + /* find the item that represents the account and activate it */ l = hdrs->priv->from_options; while (l) { @@ -770,13 +770,14 @@ e_msg_composer_hdrs_set_reply_to (EMsgComposerHdrs *hdrs, "text", reply_to, NULL); } +/* FIXME: these shouldn't take GLists, they should take CamelInternetAddress's */ void e_msg_composer_hdrs_set_to (EMsgComposerHdrs *hdrs, const GList *to_list) { g_return_if_fail (hdrs != NULL); g_return_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs)); - + set_entry (BONOBO_WIDGET (hdrs->priv->to.entry), to_list); } @@ -786,7 +787,7 @@ e_msg_composer_hdrs_set_cc (EMsgComposerHdrs *hdrs, { g_return_if_fail (hdrs != NULL); g_return_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs)); - + set_entry (BONOBO_WIDGET (hdrs->priv->cc.entry), cc_list); } @@ -796,7 +797,7 @@ e_msg_composer_hdrs_set_bcc (EMsgComposerHdrs *hdrs, { g_return_if_fail (hdrs != NULL); g_return_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs)); - + set_entry (BONOBO_WIDGET (hdrs->priv->bcc.entry), bcc_list); } @@ -807,7 +808,7 @@ e_msg_composer_hdrs_set_subject (EMsgComposerHdrs *hdrs, g_return_if_fail (hdrs != NULL); g_return_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs)); g_return_if_fail (subject != NULL); - + gtk_object_set (GTK_OBJECT (hdrs->priv->subject.entry), "text", subject, NULL); diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index f84d237fc2..57d7fc988c 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -614,23 +614,23 @@ build_message (EMsgComposer *composer) #endif /* HAVE_NSS */ return new; - + exception: - + if (part != CAMEL_MIME_PART (new)) camel_object_unref (CAMEL_OBJECT (part)); - + camel_object_unref (CAMEL_OBJECT (new)); - + if (camel_exception_is_set (&ex)) { GtkWidget *dialog; - + dialog = gnome_error_dialog_parented (camel_exception_get_description (&ex), GTK_WINDOW (composer)); gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); camel_exception_clear (&ex); } - + return NULL; } @@ -641,18 +641,18 @@ read_file_content (gint fd) gchar buf[4096]; gint n; gchar *body; - + g_return_val_if_fail (fd > 0, NULL); - + contents = g_byte_array_new (); while ((n = read (fd, buf, 4096)) > 0) { g_byte_array_append (contents, buf, n); } g_byte_array_append (contents, "\0", 1); - + body = (n < 0) ? NULL : (gchar *)contents->data; g_byte_array_free (contents, (n < 0)); - + return body; } @@ -2555,12 +2555,7 @@ e_msg_composer_new_with_message (CamelMimeMessage *msg) const char *name, *addr; if (camel_internet_address_get (to, i, &name, &addr)) { - CamelInternetAddress *cia; - - cia = camel_internet_address_new (); - camel_internet_address_add (cia, name, addr); - To = g_list_append (To, camel_address_encode (CAMEL_ADDRESS (cia))); - camel_object_unref (CAMEL_OBJECT (cia)); + To = g_list_append (To, camel_internet_address_format_address (name, addr)); } } @@ -2569,12 +2564,7 @@ e_msg_composer_new_with_message (CamelMimeMessage *msg) const char *name, *addr; if (camel_internet_address_get (cc, i, &name, &addr)) { - CamelInternetAddress *cia; - - cia = camel_internet_address_new (); - camel_internet_address_add (cia, name, addr); - Cc = g_list_append (Cc, camel_address_encode (CAMEL_ADDRESS (cia))); - camel_object_unref (CAMEL_OBJECT (cia)); + Cc = g_list_append (Cc, camel_internet_address_format_address (name, addr)); } } @@ -2583,12 +2573,7 @@ e_msg_composer_new_with_message (CamelMimeMessage *msg) const char *name, *addr; if (camel_internet_address_get (bcc, i, &name, &addr)) { - CamelInternetAddress *cia; - - cia = camel_internet_address_new (); - camel_internet_address_add (cia, name, addr); - Bcc = g_list_append (Bcc, camel_address_encode (CAMEL_ADDRESS (cia))); - camel_object_unref (CAMEL_OBJECT (cia)); + Bcc = g_list_append (Bcc, camel_internet_address_format_address (name, addr)); } } -- cgit