From 2596671b8712915820d2590c86a429257ee2d8f7 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 16 Jan 2003 19:38:44 +0000 Subject: New class, based on MailConfigAccount, for describing an evolution (mail) * e-account.c: New class, based on MailConfigAccount, for describing an evolution (mail) account. * e-account-list.c: New class for tracking the list of configured accounts. (Also uses some code from mail-config.) * e-list.c (e_list_construct, e_list_remove): New svn path=/trunk/; revision=19495 --- e-util/e-list.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'e-util/e-list.c') diff --git a/e-util/e-list.c b/e-util/e-list.c index 7ef7ce2351..f1b190b16a 100644 --- a/e-util/e-list.c +++ b/e-util/e-list.c @@ -74,17 +74,23 @@ e_list_init (EList *list) } EList * -e_list_new (EListCopyFunc copy, EListFreeFunc free, void *closure) +e_list_new (EListCopyFunc copy, EListFreeFunc free, void *closure) { EList *list = g_object_new (E_TYPE_LIST, NULL); + e_list_construct (list, copy, free, closure); + return list; +} + +void +e_list_construct (EList *list, EListCopyFunc copy, EListFreeFunc free, void *closure) +{ list->copy = copy; list->free = free; list->closure = closure; - return list; } EList * -e_list_duplicate (EList *old) +e_list_duplicate (EList *old) { EList *list = g_object_new (E_TYPE_LIST, NULL); @@ -116,7 +122,7 @@ e_list_length (EList *list) } void -e_list_append (EList *list, const void *data) +e_list_append (EList *list, const void *data) { e_list_invalidate_iterators(list, NULL); if (list->copy) @@ -125,6 +131,15 @@ e_list_append (EList *list, const void *data) list->list = g_list_append(list->list, (void *) data); } +void +e_list_remove (EList *list, const void *data) +{ + GList *link; + link = g_list_find (list->list, data); + if (link) + e_list_remove_link(list, link); +} + void e_list_invalidate_iterators (EList *list, EIterator *skip) { -- cgit v1.2.3