aboutsummaryrefslogtreecommitdiffstats
path: root/mail
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
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')
-rw-r--r--mail/ChangeLog12
-rw-r--r--mail/component-factory.c4
-rw-r--r--mail/mail-folder-cache.c30
-rw-r--r--mail/mail-folder-cache.h4
-rw-r--r--mail/mail-local.c2
-rw-r--r--mail/mail-ops.c2
-rw-r--r--mail/mail-send-recv.c9
7 files changed, 46 insertions, 17 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index b4aca31119..25e21c60c8 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,15 @@
+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.
+
2001-09-20 <NotZed@Ximian.com>
* mail-vfolder.c (check_source): Dont let drafts/outbox/sent be
diff --git a/mail/component-factory.c b/mail/component-factory.c
index dfad74626d..e8a6df7ef2 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -157,7 +157,7 @@ create_view (EvolutionShellComponent *shell_component,
}
if (!gtk_object_get_data (GTK_OBJECT (storage), "connected"))
- mail_note_store(CAMEL_STORE(store), storage, CORBA_OBJECT_NIL);
+ mail_note_store(CAMEL_STORE(store), storage, CORBA_OBJECT_NIL, NULL, NULL);
camel_object_unref (CAMEL_OBJECT (store));
control = create_noselect_control ();
@@ -1001,7 +1001,7 @@ add_storage (const char *name, const char *uri, CamelService *store,
switch (res) {
case EVOLUTION_STORAGE_OK:
mail_hash_storage (store, storage);
- mail_note_store((CamelStore *)store, storage, CORBA_OBJECT_NIL);
+ mail_note_store((CamelStore *)store, storage, CORBA_OBJECT_NIL, NULL, NULL);
/* falllll */
case EVOLUTION_STORAGE_ERROR_ALREADYREGISTERED:
case EVOLUTION_STORAGE_ERROR_EXISTS:
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);
}
diff --git a/mail/mail-folder-cache.h b/mail/mail-folder-cache.h
index 1bfdf5066a..34be34425b 100644
--- a/mail/mail-folder-cache.h
+++ b/mail/mail-folder-cache.h
@@ -31,7 +31,9 @@
/* Add a store whose folders should appear in the shell
The folders are scanned from the store, and/or added at
runtime via the folder_created event */
-void mail_note_store(struct _CamelStore *store, struct _EvolutionStorage *storage, GNOME_Evolution_Storage corba_storage);
+void
+mail_note_store(CamelStore *store, EvolutionStorage *storage, GNOME_Evolution_Storage corba_storage,
+ void (*done)(CamelStore *store, CamelFolderInfo *info, void *data), void *data);
/* When a folder has been opened, notify it for watching.
The folder must have already been created on the store (which has already been noted)
diff --git a/mail/mail-local.c b/mail/mail-local.c
index 20562d83dd..32f77e2aee 100644
--- a/mail/mail-local.c
+++ b/mail/mail-local.c
@@ -976,7 +976,7 @@ storage_listener_startup (EvolutionShellClient *shellclient)
}
/* setup to record this store's changes */
- mail_note_store((CamelStore *)global_local_store, NULL, local_corba_storage);
+ mail_note_store((CamelStore *)global_local_store, NULL, local_corba_storage, NULL, NULL);
local_storage_listener = evolution_storage_listener_new ();
corba_local_storage_listener = evolution_storage_listener_corba_objref (
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 7b01917c98..586d57dfcf 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -433,7 +433,7 @@ do_update_subfolders (CamelStore *store, CamelFolderInfo *info, void *data)
/* this interface is a little icky */
int
-mail_update_subfolders (CamelStore *store, EvolutionStorage *storage,
+samail_update_subfolders (CamelStore *store, EvolutionStorage *storage,
void (*done)(CamelStore *, void *data), void *data)
{
struct _update_info *info;
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index fff2332749..db5e23483a 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -542,7 +542,7 @@ receive_done (char *uri, void *data)
/* same for updating */
static void
-receive_update_done(CamelStore *store, void *data)
+receive_update_done(CamelStore *store, CamelFolderInfo *info, void *data)
{
receive_done("", data);
}
@@ -601,11 +601,8 @@ receive_update_got_store (char *uri, CamelStore *store, void *data)
EvolutionStorage *storage = mail_lookup_storage (store);
if (storage) {
- if (!gtk_object_get_data (GTK_OBJECT (storage), "connected"))
- mail_note_store(store, storage, CORBA_OBJECT_NIL);
-
- mail_update_subfolders (store, storage, receive_update_done, info);
- bonobo_object_unref (BONOBO_OBJECT (storage));
+ mail_note_store(store, storage, CORBA_OBJECT_NIL, receive_update_done, info);
+ /*bonobo_object_unref (BONOBO_OBJECT (storage));*/
} else {
receive_done ("", info);
}