[evolution-patches] patch for evo-mail to use new EDestination.



Smallish patch, mostly reverting the months old patch that converted
from EDestination to EABDestination in the first place.

Chris
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3215
diff -u -r1.3215 ChangeLog
--- ChangeLog	8 Apr 2004 00:06:43 -0000	1.3215
+++ ChangeLog	8 Apr 2004 03:26:32 -0000
@@ -1,3 +1,18 @@
+2004-04-07  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-07  Jeffrey Stedfast  <fejj ximian com>
 
 	* em-folder-tree.c (emft_tree_button_press): Check that
Index: em-composer-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-composer-utils.c,v
retrieving revision 1.8
diff -u -r1.8 em-composer-utils.c
--- em-composer-utils.c	29 Jan 2004 06:26:30 -0000	1.8
+++ em-composer-utils.c	8 Apr 2004 03:26:33 -0000
@@ -102,7 +102,7 @@
 }
 
 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 @@
 	
 	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 @@
 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 @@
 	/* 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 @@
 	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 @@
 			}
 		}
 		
-		eab_destination_freev (recipients_bcc);
+		e_destination_freev (recipients_bcc);
 	}
 	
 	camel_object_unref (cia);
@@ -324,7 +324,7 @@
 		
 		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 @@
 		}
 	}
 	
-	/* 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;
 }
Index: em-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-utils.c,v
retrieving revision 1.27
diff -u -r1.27 em-utils.c
--- em-utils.c	31 Mar 2004 10:09:04 -0000	1.27
+++ em-utils.c	8 Apr 2004 03:26:34 -0000
@@ -799,10 +799,10 @@
 	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 @@
 	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 @@
 		    CamelFolder *folder, const char *postto)
 {
 	const char *message_id, *references;
-	EABDestination **tov, **ccv;
+	EDestination **tov, **ccv;
 	EMsgComposer *composer;
 	char *subject;
 	
@@ -1281,7 +1281,7 @@
 	/* 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;
Index: importers/pine-importer.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/importers/pine-importer.c,v
retrieving revision 1.12
diff -u -r1.12 pine-importer.c
--- importers/pine-importer.c	17 Feb 2004 02:16:11 -0000	1.12
+++ importers/pine-importer.c	8 Apr 2004 03:26:34 -0000
@@ -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 @@
 			/* 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;
+				EDestination *d;
+				EVCardAttribute *attr;
 
-				d = eab_destination_new();
-				eab_destination_set_email(d, addrs[i]);
-				xml = eab_destination_export(d);
-				if (xml)
-					list = g_list_append(list, xml);
+				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));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]