aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/mbox
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-06-16 06:19:44 +0800
committerDan Winship <danw@src.gnome.org>2000-06-16 06:19:44 +0800
commitcd157eecb933748212bf87b41dcf5fa863e75fd5 (patch)
tree29dc32794de0449c4a7e5fb544150e57ea4183bb /camel/providers/mbox
parente1de51e60e715983d1063810ac0cbfd80f99cc2c (diff)
downloadgsoc2013-evolution-cd157eecb933748212bf87b41dcf5fa863e75fd5.tar
gsoc2013-evolution-cd157eecb933748212bf87b41dcf5fa863e75fd5.tar.gz
gsoc2013-evolution-cd157eecb933748212bf87b41dcf5fa863e75fd5.tar.bz2
gsoc2013-evolution-cd157eecb933748212bf87b41dcf5fa863e75fd5.tar.lz
gsoc2013-evolution-cd157eecb933748212bf87b41dcf5fa863e75fd5.tar.xz
gsoc2013-evolution-cd157eecb933748212bf87b41dcf5fa863e75fd5.tar.zst
gsoc2013-evolution-cd157eecb933748212bf87b41dcf5fa863e75fd5.zip
Kill. Folders are now always open, and handle "closing" sorts of
* camel-folder.c: (camel_folder_open, camel_folder_is_open, camel_folder_get_mode): Kill. Folders are now always open, and handle "closing" sorts of operations at sync or finalize time. (camel_folder_sync): renamed from camel_folder_close. Syncs state to the store but doesn't necessarily close/disconnect. * providers/*/camel-*-folder.c: Merge "open" methods into "init" methods. Rename close to sync and update appropriately. * providers/imap/camel-imap-store.c: Remove camel_imap_store_open and camel_imap_store_close, which should not have been copied from the POP provider (where the exist to work around limitations of the POP protocol). svn path=/trunk/; revision=3581
Diffstat (limited to 'camel/providers/mbox')
-rw-r--r--camel/providers/mbox/camel-mbox-folder.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/camel/providers/mbox/camel-mbox-folder.c b/camel/providers/mbox/camel-mbox-folder.c
index 0aa2f90f26..3c8de8dfcf 100644
--- a/camel/providers/mbox/camel-mbox-folder.c
+++ b/camel/providers/mbox/camel-mbox-folder.c
@@ -61,8 +61,7 @@ static void mbox_init (CamelFolder *folder, CamelStore *parent_store,
gchar *separator, gboolean path_begins_with_sep,
CamelException *ex);
-static void mbox_open (CamelFolder *folder, CamelFolderOpenMode mode, CamelException *ex);
-static void mbox_close (CamelFolder *folder, gboolean expunge, CamelException *ex);
+static void mbox_sync (CamelFolder *folder, gboolean expunge, CamelException *ex);
static gint mbox_get_message_count (CamelFolder *folder, CamelException *ex);
static void mbox_append_message (CamelFolder *folder, CamelMimeMessage *message, CamelException *ex);
static GPtrArray *mbox_get_uids (CamelFolder *folder, CamelException *ex);
@@ -97,8 +96,7 @@ camel_mbox_folder_class_init (CamelMboxFolderClass *camel_mbox_folder_class)
/* virtual method overload */
camel_folder_class->init = mbox_init;
- camel_folder_class->open = mbox_open;
- camel_folder_class->close = mbox_close;
+ camel_folder_class->sync = mbox_sync;
camel_folder_class->get_message_count = mbox_get_message_count;
camel_folder_class->append_message = mbox_append_message;
camel_folder_class->get_uids = mbox_get_uids;
@@ -162,6 +160,8 @@ mbox_init (CamelFolder *folder, CamelStore *parent_store,
{
CamelMboxFolder *mbox_folder = (CamelMboxFolder *)folder;
const gchar *root_dir_path;
+ int forceindex;
+ struct stat st;
/* call parent method */
parent_class->init (folder, parent_store, parent_folder,
@@ -197,19 +197,6 @@ mbox_init (CamelFolder *folder, CamelStore *parent_store,
mbox_folder->summary_file_path = g_strdup_printf ("%s/%s-ev-summary", root_dir_path, folder->full_name);
mbox_folder->folder_dir_path = g_strdup_printf ("%s/%s.sdb", root_dir_path, folder->full_name);
mbox_folder->index_file_path = g_strdup_printf ("%s/%s.ibex", root_dir_path, folder->full_name);
-}
-
-static void
-mbox_open (CamelFolder *folder, CamelFolderOpenMode mode, CamelException *ex)
-{
- CamelMboxFolder *mbox_folder = CAMEL_MBOX_FOLDER (folder);
- int forceindex;
- struct stat st;
-
- /* call parent class */
- parent_class->open (folder, mode, ex);
- if (camel_exception_get_id(ex))
- return;
/* if we have no index file, force it */
forceindex = stat(mbox_folder->index_file_path, &st) == -1;
@@ -237,13 +224,10 @@ mbox_open (CamelFolder *folder, CamelFolderOpenMode mode, CamelException *ex)
}
static void
-mbox_close (CamelFolder *folder, gboolean expunge, CamelException *ex)
+mbox_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
{
CamelMboxFolder *mbox_folder = CAMEL_MBOX_FOLDER (folder);
- /* call parent implementation */
- parent_class->close (folder, expunge, ex);
-
if (expunge)
mbox_expunge(folder, ex);
else