aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap/camel-imap-private.h
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-03-16 04:50:59 +0800
committerDan Winship <danw@src.gnome.org>2001-03-16 04:50:59 +0800
commit1f9d06c2aac1805bbd3922991d8332b44f16ad3e (patch)
tree0b363d1cb7795c0c20f4f734541b70291d09c213 /camel/providers/imap/camel-imap-private.h
parent892997d8c0f0cc6105ca8b0a8a369b97aab45dcb (diff)
downloadgsoc2013-evolution-1f9d06c2aac1805bbd3922991d8332b44f16ad3e.tar.gz
gsoc2013-evolution-1f9d06c2aac1805bbd3922991d8332b44f16ad3e.tar.zst
gsoc2013-evolution-1f9d06c2aac1805bbd3922991d8332b44f16ad3e.zip
First batch of disconnected IMAP-related stuff. This adds local
caching of message parts, but NOT any actual disconnected support. (But it should speed up IMAP use.) * providers/imap/camel-imap-message-cache.c: New class for caching message data to disk, and removing it when it's no longer relevant. Will eventually also support merging message parts together to save on files. Or maybe using a db instead of files? * providers/imap/camel-imap-private.h: Add a cache_lock to CamelImapFolderPrivate. This lock must be recursive, so make both locks EMutexes rather than GMutex. * providers/imap/camel-imap-folder.c (parse_fetch_response): "The only FETCH response parser you need!" Replaces the various almost-correct bits of code formerly scattered throughout this file with a single fully-correct function that can handle any FETCH response at any time, so we don't get confused by seeing a flags update when we were only expecting a message body, etc. (camel_imap_folder_fetch_data): FETCH a message body part either from the cache or the server (camel_imap_folder_changed): Remove expunged messages from the message cache. (camel_imap_folder_new): Change to take a directory instead of a summary file name. Create a CamelImapMessageCache for the folder. (imap_finalize): Unref the message cache. (camel_imap_folder_selected, imap_rescan, get_content, get_message, imap_get_message, imap_update_summary): Redone a bunch to use parse_fetch_data, CamelImapMessageCache, etc. * providers/imap/camel-imap-store.c (get_folder): Pass directory name to camel_imap_folder_new, not summary filename. Use e_path_to_physical to generate a path with /subfolders/ inserted between directory components. * providers/imap/camel-imap-wrapper.c (camel_imap_wrapper_new): Call camel_imap_folder_fetch_data (with cache_only TRUE) and if the data is cached, return an online datawrapper rather than an offline one. (write_to_stream): Use camel_imap_folder_fetch_data (with cache_only FALSE) here too * providers/imap/camel-imap-utils.c (imap_skip_list): Renamed from skip_list and made non-static. svn path=/trunk/; revision=8743
Diffstat (limited to 'camel/providers/imap/camel-imap-private.h')
-rw-r--r--camel/providers/imap/camel-imap-private.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/camel/providers/imap/camel-imap-private.h b/camel/providers/imap/camel-imap-private.h
index c7af3ee5e6..811efc5576 100644
--- a/camel/providers/imap/camel-imap-private.h
+++ b/camel/providers/imap/camel-imap-private.h
@@ -54,13 +54,14 @@ struct _CamelImapStorePrivate {
struct _CamelImapFolderPrivate {
#ifdef ENABLE_THREADS
- GMutex *search_lock; /* for locking the search object */
+ EMutex *search_lock; /* for locking the search object */
+ EMutex *cache_lock; /* for locking the cache object */
#endif
};
#ifdef ENABLE_THREADS
-#define CAMEL_IMAP_FOLDER_LOCK(f, l) (g_mutex_lock(((CamelImapFolder *)f)->priv->l))
-#define CAMEL_IMAP_FOLDER_UNLOCK(f, l) (g_mutex_unlock(((CamelImapFolder *)f)->priv->l))
+#define CAMEL_IMAP_FOLDER_LOCK(f, l) (e_mutex_lock(((CamelImapFolder *)f)->priv->l))
+#define CAMEL_IMAP_FOLDER_UNLOCK(f, l) (e_mutex_unlock(((CamelImapFolder *)f)->priv->l))
#else
#define CAMEL_IMAP_FOLDER_LOCK(f, l)
#define CAMEL_IMAP_FOLDER_UNLOCK(f, l)