diff options
-rw-r--r-- | mail/ChangeLog | 5 | ||||
-rw-r--r-- | mail/em-folder-tree-model.c | 4 | ||||
-rw-r--r-- | mail/importers/pine-importer.c | 18 |
3 files changed, 23 insertions, 4 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index f63c8dc46b..6f3ec334ab 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,8 @@ +2004-02-17 Not Zed <NotZed@Ximian.com> + + * importers/pine-importer.c (import_contact): fix for the + weird-arsed e-contact list api. and fix a small memleak. + 2004-02-13 Jeffrey Stedfast <fejj@ximian.com> * em-folder-tree.c (emft_drop_folder): Make sure the drop-target diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c index 3bb2305b9b..3d3b0f09d3 100644 --- a/mail/em-folder-tree-model.c +++ b/mail/em-folder-tree-model.c @@ -409,7 +409,7 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model, GtkTreeIter *ite GtkTreePath *path; GtkTreeIter sub; gboolean load; - + load = fi->child == NULL && !(fi->flags & (CAMEL_FOLDER_NOCHILDREN | CAMEL_FOLDER_NOINFERIORS)); path = gtk_tree_model_get_path ((GtkTreeModel *) model, iter); @@ -939,7 +939,7 @@ em_folder_tree_model_set_unread_count (EMFolderTreeModel *model, CamelStore *sto g_return_if_fail (EM_IS_FOLDER_TREE_MODEL (model)); g_return_if_fail (CAMEL_IS_STORE (store)); g_return_if_fail (path != NULL); - + if (unread < 0) unread = 0; diff --git a/mail/importers/pine-importer.c b/mail/importers/pine-importer.c index 519f1beffd..b47030fbfd 100644 --- a/mail/importers/pine-importer.c +++ b/mail/importers/pine-importer.c @@ -62,6 +62,7 @@ #include "mail/mail-component.h" #include <libebook/e-book.h> +#include <addressbook/util/eab-destination.h> #define KEY "pine-mail-imported" @@ -206,9 +207,22 @@ import_contact(EBook *book, char *line) addr[len-1] = 0; addrs = g_strsplit(addr+1, ",", 0); list = NULL; - for (i=0;addrs[i];i++) - list = g_list_append(list, addrs[i]); + /* 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); + g_object_unref(d); + } e_contact_set(card, E_CONTACT_EMAIL, list); + g_list_foreach(list, (GFunc)g_free, NULL); + g_list_free(list); g_strfreev(addrs); e_contact_set(card, E_CONTACT_IS_LIST, GINT_TO_POINTER(TRUE)); } else { |