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
This commit is contained in:
1
2001-09-21 05:58:31 +00:00
committed by Michael Zucci
parent 03238847a7
commit b2e7adf9b8
7 changed files with 46 additions and 17 deletions
+12
View File
@@ -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
+2 -2
View File
@@ -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:
+24 -6
View File
@@ -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);
}
+3 -1
View File
@@ -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)
+1 -1
View File
@@ -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 (
+1 -1
View File
@@ -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;
+3 -6
View File
@@ -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);
}