aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap/camel-imap-summary.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-03-21 01:38:46 +0800
committerDan Winship <danw@src.gnome.org>2001-03-21 01:38:46 +0800
commitfbb7448b5e10f89471432478789605cfe36ccff3 (patch)
tree0a32a790063326be8ef8a34b1da13db401a07251 /camel/providers/imap/camel-imap-summary.c
parent8047141a5085c7eb096f940b757880ca249b19a0 (diff)
downloadgsoc2013-evolution-fbb7448b5e10f89471432478789605cfe36ccff3.tar
gsoc2013-evolution-fbb7448b5e10f89471432478789605cfe36ccff3.tar.gz
gsoc2013-evolution-fbb7448b5e10f89471432478789605cfe36ccff3.tar.bz2
gsoc2013-evolution-fbb7448b5e10f89471432478789605cfe36ccff3.tar.lz
gsoc2013-evolution-fbb7448b5e10f89471432478789605cfe36ccff3.tar.xz
gsoc2013-evolution-fbb7448b5e10f89471432478789605cfe36ccff3.tar.zst
gsoc2013-evolution-fbb7448b5e10f89471432478789605cfe36ccff3.zip
Function to check if the store is online and set an exception if not.
* providers/imap/camel-imap-store.c (camel_imap_store_check_online): Function to check if the store is online and set an exception if not. Currently controlled by an environment variable, but eventually there will be both a global (session-level) setting and a per-store setting. (construct): Set up storage_path and base_url here rather than at connect-time. (imap_auth_loop): Split out from imap_connect. (imap_setup_online): Split out from imap_connect. Do the post-authentication connection setup, and cache the results to disk. (imap_setup_offline): Set up a CamelImapStore with information saved from a previous imap_setup_online. (imap_connect): If online, do connect_to_server(), imap_auth_loop(), and imap_setup_online(). Otherwise, do imap_setup_offline(). (get_folder, get_folder_info): Add offline support. (create_folder, subscribe_folder, unsubscribe_folder): Disable these when offline (for now). * providers/imap/camel-imap-folder.c (camel_imap_folder_new): Remove the sync'ing-with-server stuff... it's done by camel_imap_folder_selected now, which only gets called if the store is online. (camel_imap_folder_selected): add the code removed from camel_imap_folder_new. Besides simplifying the folder_new and summary_new code, this also means now that we'll DTRT if a folder's UIDVALIDITY changes while we're connected. Also, when that happens, clear the message cache explicitly. (imap_refresh_info, imap_sync): These are no-ops when offline. (imap_expunge, imap_append_message, imap_copy_message_to, imap_search_by_expression): These don't yet work offline. (imap_get_message, camel_imap_folder_fetch_data): Return an error when trying to fetch a non-cached body part when we're offline. * providers/imap/camel-imap-summary.c (camel_imap_summary_new): Rewrite to not check the validity here. (We'll do it from camel_imap_folder_selected instead.) * providers/imap/camel-imap-command.c (camel_imap_command): Call camel_imap_folder_selected even when the selection is all we're doing, to match the changes in camel-imap-folder.c. * providers/imap/camel-imap-message-cache.c (camel_imap_message_cache_clear): New function to clear out a message cache. svn path=/trunk/; revision=8851
Diffstat (limited to 'camel/providers/imap/camel-imap-summary.c')
-rw-r--r--camel/providers/imap/camel-imap-summary.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/camel/providers/imap/camel-imap-summary.c b/camel/providers/imap/camel-imap-summary.c
index 66228649bc..34597cfe31 100644
--- a/camel/providers/imap/camel-imap-summary.c
+++ b/camel/providers/imap/camel-imap-summary.c
@@ -99,16 +99,14 @@ camel_imap_summary_init (CamelImapSummary *obj)
/**
* camel_imap_summary_new:
* @filename: the file to store the summary in.
- * @validity: the current UIDVALIDITY value of the folder
*
* This will create a new CamelImapSummary object and read in the
- * summary data from disk, if it exists and has the right UIDVALIDITY
- * value.
+ * summary data from disk, if it exists.
*
* Return value: A new CamelImapSummary object.
**/
CamelFolderSummary *
-camel_imap_summary_new (const char *filename, guint32 validity)
+camel_imap_summary_new (const char *filename)
{
CamelFolderSummary *summary = CAMEL_FOLDER_SUMMARY (
camel_object_new (camel_imap_summary_get_type ()));
@@ -118,21 +116,8 @@ camel_imap_summary_new (const char *filename, guint32 validity)
camel_folder_summary_set_filename (summary, filename);
if (camel_folder_summary_load (summary) == -1) {
- if (errno == ENOENT) {
- imap_summary->validity = validity;
- return summary;
- } else {
- /* FIXME: are there error conditions where this won't work? */
- camel_folder_summary_clear (summary);
- camel_folder_summary_touch (summary);
-
- return summary;
- }
- }
-
- if (imap_summary->validity != validity) {
camel_folder_summary_clear (summary);
- imap_summary->validity = validity;
+ camel_folder_summary_touch (summary);
}
return summary;