aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-02-17 10:16:11 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-02-17 10:16:11 +0800
commit78ec5fde6654a7118b0e7e6d203fcece872af28a (patch)
treeeb7f0134ee135a2fb3bfb7d079d4a9caf0b35ad1
parent3cc6e89e669f8d99c39de2e558e79ae69cf43dd9 (diff)
downloadgsoc2013-evolution-78ec5fde6654a7118b0e7e6d203fcece872af28a.tar
gsoc2013-evolution-78ec5fde6654a7118b0e7e6d203fcece872af28a.tar.gz
gsoc2013-evolution-78ec5fde6654a7118b0e7e6d203fcece872af28a.tar.bz2
gsoc2013-evolution-78ec5fde6654a7118b0e7e6d203fcece872af28a.tar.lz
gsoc2013-evolution-78ec5fde6654a7118b0e7e6d203fcece872af28a.tar.xz
gsoc2013-evolution-78ec5fde6654a7118b0e7e6d203fcece872af28a.tar.zst
gsoc2013-evolution-78ec5fde6654a7118b0e7e6d203fcece872af28a.zip
fix for the weird-arsed e-contact list api. and fix a small memleak.
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. svn path=/trunk/; revision=24753
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/em-folder-tree-model.c4
-rw-r--r--mail/importers/pine-importer.c18
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 {