From 54e037a91cf1de9d82f87675e1bf857d90763f4d Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Fri, 13 Jul 2001 17:35:51 +0000 Subject: Let people install as non-root, but give them a bigass warning so they're 2001-07-13 Peter Williams * Makefile.am (install-exec-local): Let people install as non-root, but give them a bigass warning so they're not allowed to complain when it doesn't work right. * camel-remote-store.c (sync_remote_folder): New function: hash table callback. (remote_disconnect): If cleanly disconnecting, sync our folders. Fixes deadlocks on exit (folders syncing after store disconnects) and also makes sense. svn path=/trunk/; revision=11090 --- camel/camel-remote-store.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'camel/camel-remote-store.c') diff --git a/camel/camel-remote-store.c b/camel/camel-remote-store.c index 65445189fd..823a4673f4 100644 --- a/camel/camel-remote-store.c +++ b/camel/camel-remote-store.c @@ -281,6 +281,16 @@ remote_connect (CamelService *service, CamelException *ex) return TRUE; } + +static void +sync_remote_folder (gpointer key, gpointer value, gpointer data) +{ + CamelFolder *folder = CAMEL_FOLDER (value); + + if (!camel_exception_is_set ((CamelException *) data)) + camel_folder_sync (folder, FALSE, (CamelException *) data); +} + static gboolean remote_disconnect (CamelService *service, gboolean clean, CamelException *ex) { @@ -292,6 +302,10 @@ remote_disconnect (CamelService *service, gboolean clean, CamelException *ex) store->timeout_id = 0; } + if (clean) + /* sync all folders */ + g_hash_table_foreach (CAMEL_STORE (store)->folders, sync_remote_folder, ex); + if (!CAMEL_SERVICE_CLASS (store_class)->disconnect (service, clean, ex)) return FALSE; -- cgit v1.2.3