diff options
author | Chris Toshok <toshok@ximian.com> | 2004-04-10 01:30:58 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2004-04-10 01:30:58 +0800 |
commit | 16b7fae670745f3dc7b8858e50dc08f7778f5b09 (patch) | |
tree | 2761add580f5f051916b63d8a3d81f52c9ccfeae | |
parent | 65ea752b795545b15ecf68bd4835c27d05f58be1 (diff) | |
download | gsoc2013-evolution-16b7fae670745f3dc7b8858e50dc08f7778f5b09.tar.gz gsoc2013-evolution-16b7fae670745f3dc7b8858e50dc08f7778f5b09.tar.zst gsoc2013-evolution-16b7fae670745f3dc7b8858e50dc08f7778f5b09.zip |
use e_destination_export_to_vcard_attribute instead of exporting to xml,
2004-04-09 Chris Toshok <toshok@ximian.com>
* importers/pine-importer.c (import_contact): use
e_destination_export_to_vcard_attribute instead of exporting to
xml, and use e_contact_set_attributes.
* em-utils.c (em_utils_camel_address_to_destination):
EABDestination -> EDestination.
(reply_get_composer): same
(post_reply_to_message): same.
* em-composer-utils.c (ask_confirm_for_unwanted_html_mail):
EABDestination -> EDestination.
(composer_get_message): same.
svn path=/trunk/; revision=25392
-rw-r--r-- | mail/ChangeLog | 15 | ||||
-rw-r--r-- | mail/em-composer-utils.c | 26 | ||||
-rw-r--r-- | mail/em-utils.c | 16 | ||||
-rw-r--r-- | mail/importers/pine-importer.c | 23 |
4 files changed, 46 insertions, 34 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 8e22a1277b..50c773abc0 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,18 @@ +2004-04-09 Chris Toshok <toshok@ximian.com> + + * importers/pine-importer.c (import_contact): use + e_destination_export_to_vcard_attribute instead of exporting to + xml, and use e_contact_set_attributes. + + * em-utils.c (em_utils_camel_address_to_destination): + EABDestination -> EDestination. + (reply_get_composer): same + (post_reply_to_message): same. + + * em-composer-utils.c (ask_confirm_for_unwanted_html_mail): + EABDestination -> EDestination. + (composer_get_message): same. + 2004-04-09 Radek Doulik <rodo@ximian.com> * em-format-html.c (efh_format_headers): add width=16 height=16 to diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 6694b77403..a3ece89b7a 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -102,7 +102,7 @@ composer_destroy_cb (gpointer user_data, GObject *deadbeef) } static gboolean -ask_confirm_for_unwanted_html_mail (EMsgComposer *composer, EABDestination **recipients) +ask_confirm_for_unwanted_html_mail (EMsgComposer *composer, EDestination **recipients) { gboolean res; GString *str; @@ -110,10 +110,10 @@ ask_confirm_for_unwanted_html_mail (EMsgComposer *composer, EABDestination **rec str = g_string_new(""); for (i = 0; recipients[i] != NULL; ++i) { - if (!eab_destination_get_html_mail_pref (recipients[i])) { + if (!e_destination_get_html_mail_pref (recipients[i])) { const char *name; - name = eab_destination_get_textrep (recipients[i], FALSE); + name = e_destination_get_textrep (recipients[i], FALSE); g_string_append_printf (str, " %s\n", name); } @@ -234,7 +234,7 @@ static CamelMimeMessage * composer_get_message (EMsgComposer *composer, gboolean post, gboolean save_html_object_data, gboolean *no_recipients) { CamelMimeMessage *message = NULL; - EABDestination **recipients, **recipients_bcc; + EDestination **recipients, **recipients_bcc; gboolean send_html, confirm_html; CamelInternetAddress *cia; int hidden = 0, shown = 0; @@ -258,15 +258,15 @@ composer_get_message (EMsgComposer *composer, gboolean post, gboolean save_html_ /* see which ones are visible/present, etc */ if (recipients) { for (i = 0; recipients[i] != NULL; i++) { - const char *addr = eab_destination_get_address (recipients[i]); + const char *addr = e_destination_get_address (recipients[i]); if (addr && addr[0]) { camel_address_decode ((CamelAddress *) cia, addr); if (camel_address_length ((CamelAddress *) cia) > 0) { camel_address_remove ((CamelAddress *) cia, -1); num++; - if (eab_destination_is_evolution_list (recipients[i]) - && !eab_destination_list_show_addresses (recipients[i])) { + if (e_destination_is_evolution_list (recipients[i]) + && !e_destination_list_show_addresses (recipients[i])) { hidden++; } else { shown++; @@ -279,7 +279,7 @@ composer_get_message (EMsgComposer *composer, gboolean post, gboolean save_html_ recipients_bcc = e_msg_composer_get_bcc (composer); if (recipients_bcc) { for (i = 0; recipients_bcc[i] != NULL; i++) { - const char *addr = eab_destination_get_address (recipients_bcc[i]); + const char *addr = e_destination_get_address (recipients_bcc[i]); if (addr && addr[0]) { camel_address_decode ((CamelAddress *) cia, addr); @@ -290,7 +290,7 @@ composer_get_message (EMsgComposer *composer, gboolean post, gboolean save_html_ } } - eab_destination_freev (recipients_bcc); + e_destination_freev (recipients_bcc); } camel_object_unref (cia); @@ -324,7 +324,7 @@ composer_get_message (EMsgComposer *composer, gboolean post, gboolean save_html_ if (recipients) { for (i = 0; recipients[i] != NULL && !html_problem; i++) { - if (!eab_destination_get_html_mail_pref (recipients[i])) + if (!e_destination_get_html_mail_pref (recipients[i])) html_problem = TRUE; } } @@ -364,14 +364,10 @@ composer_get_message (EMsgComposer *composer, gboolean post, gboolean save_html_ } } - /* Get the message recipients and 'touch' them, boosting their use scores */ - if (recipients) - eab_destination_touchv (recipients); - finished: if (recipients) - eab_destination_freev (recipients); + e_destination_freev (recipients); return message; } diff --git a/mail/em-utils.c b/mail/em-utils.c index 7a553ad68c..60d2bd659b 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -799,10 +799,10 @@ generate_account_hash (void) return account_hash; } -static EABDestination ** +static EDestination ** em_utils_camel_address_to_destination (CamelInternetAddress *iaddr) { - EABDestination *dest, **destv; + EDestination *dest, **destv; int n, i, j; if (iaddr == NULL) @@ -811,14 +811,14 @@ em_utils_camel_address_to_destination (CamelInternetAddress *iaddr) if ((n = camel_address_length ((CamelAddress *) iaddr)) == 0) return NULL; - destv = g_malloc (sizeof (EABDestination *) * (n + 1)); + destv = g_malloc (sizeof (EDestination *) * (n + 1)); for (i = 0, j = 0; i < n; i++) { const char *name, *addr; if (camel_internet_address_get (iaddr, i, &name, &addr)) { - dest = eab_destination_new (); - eab_destination_set_name (dest, name); - eab_destination_set_email (dest, addr); + dest = e_destination_new (); + e_destination_set_name (dest, name); + e_destination_set_email (dest, addr); destv[j++] = dest; } @@ -840,7 +840,7 @@ reply_get_composer (CamelMimeMessage *message, EAccount *account, CamelFolder *folder, const char *postto) { const char *message_id, *references; - EABDestination **tov, **ccv; + EDestination **tov, **ccv; EMsgComposer *composer; char *subject; @@ -1281,7 +1281,7 @@ post_reply_to_message (CamelFolder *folder, const char *uid, CamelMimeMessage *m /* FIXME: would be nice if this shared more code with reply_get_composer() */ const char *message_id, *references; CamelInternetAddress *to = NULL; - EABDestination **tov = NULL; + EDestination **tov = NULL; EMsgComposer *composer; char *subject, *url; EAccount *account; diff --git a/mail/importers/pine-importer.c b/mail/importers/pine-importer.c index b47030fbfd..21b0eebf02 100644 --- a/mail/importers/pine-importer.c +++ b/mail/importers/pine-importer.c @@ -62,7 +62,7 @@ #include "mail/mail-component.h" #include <libebook/e-book.h> -#include <addressbook/util/eab-destination.h> +#include <addressbook/util/e-destination.h> #define KEY "pine-mail-imported" @@ -210,18 +210,19 @@ import_contact(EBook *book, char *line) /* So ... this api is just insane ... we set plain strings as the contact email if it is a normal contact, but need to do this xml crap for mailing lists */ for (i=0;addrs[i];i++) { - EABDestination *d; - char *xml; - - d = eab_destination_new(); - eab_destination_set_email(d, addrs[i]); - xml = eab_destination_export(d); - if (xml) - list = g_list_append(list, xml); + EDestination *d; + EVCardAttribute *attr; + + d = e_destination_new(); + e_destination_set_email(d, addrs[i]); + + attr = e_vcard_attribute_new (NULL, EVC_EMAIL); + e_destination_export_to_vcard_attribute (d, attr); + list = g_list_append(list, attr); g_object_unref(d); } - e_contact_set(card, E_CONTACT_EMAIL, list); - g_list_foreach(list, (GFunc)g_free, NULL); + e_contact_set_attributes(card, E_CONTACT_EMAIL, list); + g_list_foreach(list, (GFunc)e_vcard_attribute_free, NULL); g_list_free(list); g_strfreev(addrs); e_contact_set(card, E_CONTACT_IS_LIST, GINT_TO_POINTER(TRUE)); |