aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2003-08-02 03:30:39 +0800
committerMichael Zucci <zucchi@src.gnome.org>2003-08-02 03:30:39 +0800
commit9861660fdf5558f92f87387dce77a8d34013ef44 (patch)
tree1b9992fdc8f425eb7b3c967010a0aed9155de8f7
parent1b7da17c253261888de022fa0d6bebaa2d63df7a (diff)
downloadgsoc2013-evolution-9861660fdf5558f92f87387dce77a8d34013ef44.tar
gsoc2013-evolution-9861660fdf5558f92f87387dce77a8d34013ef44.tar.gz
gsoc2013-evolution-9861660fdf5558f92f87387dce77a8d34013ef44.tar.bz2
gsoc2013-evolution-9861660fdf5558f92f87387dce77a8d34013ef44.tar.lz
gsoc2013-evolution-9861660fdf5558f92f87387dce77a8d34013ef44.tar.xz
gsoc2013-evolution-9861660fdf5558f92f87387dce77a8d34013ef44.tar.zst
gsoc2013-evolution-9861660fdf5558f92f87387dce77a8d34013ef44.zip
add a CamelOperation for overriding status handler.
2003-07-29 Not Zed <NotZed@Ximian.com> * mail-folder-cache.c (mail_note_store): add a CamelOperation for overriding status handler. * mail-send-recv.c (receive_update_got_store): Pass our own cancel handle to get_folderinfo and mail_note_store. (mail_send_receive, mail_receive_uri): Same for get_store. * mail-ops.c (mail_get_store, mail_get_folderinfo): Add a CamelOperation argument, for overriding the status handler. Fixed most calles to pass NULL to use the default. svn path=/trunk/; revision=22056
-rw-r--r--mail/ChangeLog13
-rw-r--r--mail/component-factory.c4
-rw-r--r--mail/mail-account-gui.c2
-rw-r--r--mail/mail-folder-cache.c6
-rw-r--r--mail/mail-folder-cache.h2
-rw-r--r--mail/mail-local.c2
-rw-r--r--mail/mail-offline-handler.c2
-rw-r--r--mail/mail-ops.c14
-rw-r--r--mail/mail-ops.h4
-rw-r--r--mail/mail-send-recv.c10
-rw-r--r--mail/subscribe-dialog.c2
11 files changed, 41 insertions, 20 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index bbc40ffa6e..962f8ea39a 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,16 @@
+2003-07-29 Not Zed <NotZed@Ximian.com>
+
+ * mail-folder-cache.c (mail_note_store): add a CamelOperation for
+ overriding status handler.
+
+ * mail-send-recv.c (receive_update_got_store): Pass our own cancel
+ handle to get_folderinfo and mail_note_store.
+ (mail_send_receive, mail_receive_uri): Same for get_store.
+
+ * mail-ops.c (mail_get_store, mail_get_folderinfo): Add a
+ CamelOperation argument, for overriding the status handler. Fixed
+ most calles to pass NULL to use the default.
+
2003-08-01 Harry Lu <harry.lu@sun.com>
*Fix for bug #6951
diff --git a/mail/component-factory.c b/mail/component-factory.c
index b3077f5699..8789bcde8a 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -1345,7 +1345,7 @@ storage_connect (EvolutionStorage *storage,
const char *path,
CamelStore *store)
{
- mail_note_store (CAMEL_STORE (store), storage, CORBA_OBJECT_NIL,
+ mail_note_store (CAMEL_STORE (store), NULL, storage, CORBA_OBJECT_NIL,
storage_connected, listener);
}
@@ -1369,7 +1369,7 @@ add_storage (const char *name, const char *uri, CamelService *store,
evolution_storage_has_subfolders (storage, "/", _("Connecting..."));
mail_hash_storage (store, storage);
/*if (auto_connect)*/
- mail_note_store ((CamelStore *) store, storage, CORBA_OBJECT_NIL, NULL, NULL);
+ mail_note_store ((CamelStore *) store, NULL, storage, CORBA_OBJECT_NIL, NULL, NULL);
/* falllll */
case EVOLUTION_STORAGE_ERROR_ALREADYREGISTERED:
case EVOLUTION_STORAGE_ERROR_EXISTS:
diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c
index f33c026edf..2bba8944e6 100644
--- a/mail/mail-account-gui.c
+++ b/mail/mail-account-gui.c
@@ -2001,7 +2001,7 @@ mail_account_gui_save (MailAccountGui *gui)
component, then get the CamelStore and add it to
the shell storages */
if (is_storage && account->enabled)
- mail_get_store (account->source->url, add_new_store, account);
+ mail_get_store (account->source->url, NULL, add_new_store, account);
if (gtk_toggle_button_get_active (gui->default_account))
mail_config_set_default_account (account);
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index 6803119733..ed50689630 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -809,7 +809,7 @@ store_online_cb (CamelStore *store, void *data)
if (g_hash_table_lookup(stores, store) != NULL) {
/* re-use the cancel id. we're already in the store update list too */
- ud->id = mail_get_folderinfo(store, update_folders, ud);
+ ud->id = mail_get_folderinfo(store, NULL, update_folders, ud);
} else {
/* the store vanished, that means we were probably cancelled, or at any rate,
need to clean ourselves up */
@@ -820,7 +820,7 @@ store_online_cb (CamelStore *store, void *data)
}
void
-mail_note_store(CamelStore *store, EvolutionStorage *storage, GNOME_Evolution_Storage corba_storage,
+mail_note_store(CamelStore *store, CamelOperation *op, EvolutionStorage *storage, GNOME_Evolution_Storage corba_storage,
void (*done)(CamelStore *store, CamelFolderInfo *info, void *data), void *data)
{
struct _store_info *si;
@@ -887,7 +887,7 @@ mail_note_store(CamelStore *store, EvolutionStorage *storage, GNOME_Evolution_St
ud = g_malloc (sizeof (*ud));
ud->done = done;
ud->data = data;
- ud->id = mail_get_folderinfo (store, update_folders, ud);
+ ud->id = mail_get_folderinfo (store, op, update_folders, ud);
e_dlist_addtail (&si->folderinfo_updates, (EDListNode *) ud);
}
diff --git a/mail/mail-folder-cache.h b/mail/mail-folder-cache.h
index 8f3309e74f..3d612d7d6b 100644
--- a/mail/mail-folder-cache.h
+++ b/mail/mail-folder-cache.h
@@ -31,7 +31,7 @@
The folders are scanned from the store, and/or added at
runtime via the folder_created event */
void
-mail_note_store(CamelStore *store, EvolutionStorage *storage, GNOME_Evolution_Storage corba_storage,
+mail_note_store(CamelStore *store, CamelOperation *op, EvolutionStorage *storage, GNOME_Evolution_Storage corba_storage,
void (*done)(CamelStore *store, CamelFolderInfo *info, void *data), void *data);
/* de-note a store */
diff --git a/mail/mail-local.c b/mail/mail-local.c
index 5db550d46d..80950935a9 100644
--- a/mail/mail-local.c
+++ b/mail/mail-local.c
@@ -1218,7 +1218,7 @@ storage_listener_startup (EvolutionShellClient *shellclient)
}
/* setup to record this store's changes */
- mail_note_store((CamelStore *)global_local_store, NULL, local_corba_storage, NULL, NULL);
+ mail_note_store((CamelStore *)global_local_store, NULL, 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-offline-handler.c b/mail/mail-offline-handler.c
index 37a2a6eaae..ccaff703f5 100644
--- a/mail/mail-offline-handler.c
+++ b/mail/mail-offline-handler.c
@@ -270,7 +270,7 @@ storage_go_online (gpointer key, gpointer value, gpointer data)
if (service_is_relevant (CAMEL_SERVICE (store), FALSE)) {
mail_store_set_offline (store, FALSE, NULL, NULL);
- mail_note_store (store, NULL, CORBA_OBJECT_NIL,
+ mail_note_store (store, NULL, NULL, CORBA_OBJECT_NIL,
NULL, NULL);
}
}
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index f3469bf3e6..7a40e99c83 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -1167,12 +1167,17 @@ static struct _mail_msg_op get_folderinfo_op = {
};
int
-mail_get_folderinfo (CamelStore *store, void (*done)(CamelStore *store, CamelFolderInfo *info, void *data), void *data)
+mail_get_folderinfo (CamelStore *store, CamelOperation *op, void (*done)(CamelStore *store, CamelFolderInfo *info, void *data), void *data)
{
struct _get_folderinfo_msg *m;
int id;
m = mail_msg_new(&get_folderinfo_op, NULL, sizeof(*m));
+ if (op) {
+ camel_operation_unref(m->msg.cancel);
+ m->msg.cancel = op;
+ camel_operation_ref(op);
+ }
m->store = store;
camel_object_ref(store);
m->done = done;
@@ -1379,12 +1384,17 @@ static struct _mail_msg_op get_store_op = {
};
int
-mail_get_store (const char *uri, void (*done) (char *uri, CamelStore *store, void *data), void *data)
+mail_get_store (const char *uri, CamelOperation *op, void (*done) (char *uri, CamelStore *store, void *data), void *data)
{
struct _get_store_msg *m;
int id;
m = mail_msg_new (&get_store_op, NULL, sizeof (*m));
+ if (op) {
+ camel_operation_unref(m->msg.cancel);
+ m->msg.cancel = op;
+ camel_operation_ref(op);
+ }
m->uri = g_strdup (uri);
m->data = data;
m->done = done;
diff --git a/mail/mail-ops.h b/mail/mail-ops.h
index 47b082b0ff..f81829db45 100644
--- a/mail/mail-ops.h
+++ b/mail/mail-ops.h
@@ -68,7 +68,7 @@ int mail_get_folder (const char *uri, guint32 flags,
EThread *thread);
/* and for a store */
-int mail_get_store (const char *uri,
+int mail_get_store (const char *uri, CamelOperation *op,
void (*done) (char *uri, CamelStore *store, void *data), void *data);
/* build an attachment */
@@ -94,7 +94,7 @@ void mail_empty_trash (EAccount *account,
void *data);
/* get folder info asynchronously */
-int mail_get_folderinfo (CamelStore *store,
+int mail_get_folderinfo (CamelStore *store, CamelOperation *op,
void (*done)(CamelStore *store, CamelFolderInfo *info, void *data),
void *data);
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index 5cd2620b21..469f0494c2 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -669,7 +669,7 @@ receive_update_got_store (char *uri, CamelStore *store, void *data)
EvolutionStorage *storage = mail_lookup_storage (store);
if (storage) {
- mail_note_store(store, storage, CORBA_OBJECT_NIL, receive_update_done, info);
+ mail_note_store(store, info->cancel, storage, CORBA_OBJECT_NIL, receive_update_done, info);
/*bonobo_object_unref (BONOBO_OBJECT (storage));*/
} else {
/* If we get here, store must be an external
@@ -677,7 +677,7 @@ receive_update_got_store (char *uri, CamelStore *store, void *data)
* Do a get_folder_info just to force it to
* update itself.
*/
- mail_get_folderinfo(store, receive_update_got_folderinfo, info);
+ mail_get_folderinfo(store, info->cancel, receive_update_got_folderinfo, info);
}
} else {
receive_done ("", info);
@@ -733,8 +733,7 @@ GtkWidget *mail_send_receive (void)
receive_done, info);
break;
case SEND_UPDATE:
- /* FIXME: error reporting? */
- mail_get_store(info->uri, receive_update_got_store, info);
+ mail_get_store(info->uri, info->cancel, receive_update_got_store, info);
break;
default:
g_assert_not_reached ();
@@ -900,8 +899,7 @@ mail_receive_uri (const char *uri, int keep)
receive_done, info);
break;
case SEND_UPDATE:
- /* FIXME: error reporting? */
- mail_get_store (info->uri, receive_update_got_store, info);
+ mail_get_store (info->uri, info->cancel, receive_update_got_store, info);
break;
default:
g_assert_not_reached ();
diff --git a/mail/subscribe-dialog.c b/mail/subscribe-dialog.c
index e9323fd74b..cf9768aff0 100644
--- a/mail/subscribe-dialog.c
+++ b/mail/subscribe-dialog.c
@@ -1139,7 +1139,7 @@ store_data_async_get_store (StoreData *sd, StoreDataStoreFunc func, gpointer use
sd->store_func = func;
sd->store_data = user_data;
store_data_ref (sd);
- sd->request_id = mail_get_store (sd->uri, sd_got_store, sd);
+ sd->request_id = mail_get_store (sd->uri, NULL, sd_got_store, sd);
}
static void