aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-folder-cache.c
diff options
context:
space:
mode:
author1 <NotZed@Ximian.com>2001-09-21 13:58:31 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-09-21 13:58:31 +0800
commitb2e7adf9b88f9dda003f4e077c5db0dc8cb50d8b (patch)
treeebc5a4cdbefa3b6909683c66d8b55719dfe79b04 /mail/mail-folder-cache.c
parent03238847a7bfc2717a2bd4fe636a42b3a42bc4af (diff)
downloadgsoc2013-evolution-b2e7adf9b88f9dda003f4e077c5db0dc8cb50d8b.tar.gz
gsoc2013-evolution-b2e7adf9b88f9dda003f4e077c5db0dc8cb50d8b.tar.zst
gsoc2013-evolution-b2e7adf9b88f9dda003f4e077c5db0dc8cb50d8b.zip
Take a new argument 'done' that can callback when complete. Fixed callers
2001-09-21 <NotZed@Ximian.com> * mail-folder-cache.c (mail_note_store): Take a new argument 'done' that can callback when complete. Fixed callers appropriately. * mail-ops.c (mail_update_subfolders): Removed. Isn't used anymore. * mail-send-recv.c (receive_update_got_store): Remove call to mail_update_subfolders. svn path=/trunk/; revision=13044
Diffstat (limited to 'mail/mail-folder-cache.c')
-rw-r--r--mail/mail-folder-cache.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index 4d9a881826..90ab1a805b 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -294,22 +294,33 @@ create_folders(CamelFolderInfo *fi, struct _store_info *si)
create_folders(fi->sibling, si);
}
+struct _update_data {
+ struct _store_info *si;
+ void (*done)(CamelStore *store, CamelFolderInfo *info, void *data);
+ void *data;
+};
+
static void
update_folders(CamelStore *store, CamelFolderInfo *info, void *data)
{
- struct _store_info *si = data;
+ struct _update_data *ud = data;
if (info) {
- if (si->storage)
- gtk_object_set_data (GTK_OBJECT (si->storage), "connected", GINT_TO_POINTER (TRUE));
- create_folders(info, si);
+ if (ud->si->storage)
+ gtk_object_set_data (GTK_OBJECT (ud->si->storage), "connected", GINT_TO_POINTER (TRUE));
+ create_folders(info, ud->si);
}
+ if (ud->done)
+ ud->done(store, info, ud->data);
+ g_free(ud);
}
void
-mail_note_store(CamelStore *store, EvolutionStorage *storage, GNOME_Evolution_Storage corba_storage)
+mail_note_store(CamelStore *store, EvolutionStorage *storage, GNOME_Evolution_Storage corba_storage,
+ void (*done)(CamelStore *store, CamelFolderInfo *info, void *data), void *data)
{
struct _store_info *si;
+ struct _update_data *ud;
g_assert(CAMEL_IS_STORE(store));
g_assert(pthread_self() == mail_gui_thread);
@@ -325,6 +336,8 @@ mail_note_store(CamelStore *store, EvolutionStorage *storage, GNOME_Evolution_St
d(printf("Noting a new store: %p: %s\n", store, camel_url_to_string(((CamelService *)store)->url, 0)));
+ /* FIXME: Need to ref the storages or something?? */
+
si = g_malloc0(sizeof(*si));
si->folders = g_hash_table_new(g_str_hash, g_str_equal);
si->storage = storage;
@@ -338,5 +351,10 @@ mail_note_store(CamelStore *store, EvolutionStorage *storage, GNOME_Evolution_St
UNLOCK(info_lock);
- mail_get_folderinfo(store, update_folders, si);
+ ud = g_malloc(sizeof(*ud));
+ ud->si = si;
+ ud->done = done;
+ ud->data = data;
+
+ mail_get_folderinfo(store, update_folders, ud);
}