aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/local/camel-spool-folder.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-09-28 12:32:13 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-09-28 12:32:13 +0800
commitf3c3a422abf537dcfc24030433e9556d34d71492 (patch)
tree7c4f1556de175249a8b2ed474e4f28b26b18ab70 /camel/providers/local/camel-spool-folder.c
parentabfce8d7d7a749b0073e3140ed2157b230f5d136 (diff)
downloadgsoc2013-evolution-f3c3a422abf537dcfc24030433e9556d34d71492.tar.gz
gsoc2013-evolution-f3c3a422abf537dcfc24030433e9556d34d71492.tar.zst
gsoc2013-evolution-f3c3a422abf537dcfc24030433e9556d34d71492.zip
make sure body indexing is turned off always, missed the ~ bit.
2004-09-27 Not Zed <NotZed@Ximian.com> * providers/local/camel-spool-folder.c (camel_spool_folder_new): make sure body indexing is turned off always, missed the ~ bit. * providers/local/camel-spool-store.c (camel_folder_info_new): dont take unread count. (spool_fill_fi): copied from mbox more or less. (scan_dir): use fill_fi to setup counts. (spool_new_fi): replace camel_foldeR_info_new with one that does most of the work, also generates uri's properly. (get_folder_info_mbox): make the 'system' inbox name translatable. * providers/local/camel-mbox-folder.h: make the camel_mbox_folder_get* functions properly public. * providers/local/camel-local-folder.h: pass the object to the virtual methods now, fix all callers. * providers/local/camel-spool-folder.c (spool_get_full_path) (spool_get_meta_path): implement, this needs to work differnetly to the parent classes implementations :-/. svn path=/trunk/; revision=27407
Diffstat (limited to 'camel/providers/local/camel-spool-folder.c')
-rw-r--r--camel/providers/local/camel-spool-folder.c37
1 files changed, 33 insertions, 4 deletions
diff --git a/camel/providers/local/camel-spool-folder.c b/camel/providers/local/camel-spool-folder.c
index 026d99402e..b9cb643189 100644
--- a/camel/providers/local/camel-spool-folder.c
+++ b/camel/providers/local/camel-spool-folder.c
@@ -41,6 +41,8 @@
#include "camel-stream-filter.h"
#include "camel-mime-filter-from.h"
#include "camel-exception.h"
+#include "camel-session.h"
+#include "camel-file-utils.h"
#include "camel-lock-client.h"
#include "camel-local-private.h"
#include "camel-i18n.h"
@@ -54,7 +56,9 @@ static CamelFolderClass *parent_class = NULL;
#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
#define CSPOOLS_CLASS(so) CAMEL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-static CamelLocalSummary *spool_create_summary(const char *path, const char *folder, CamelIndex *index);
+static char *spool_get_full_path(CamelLocalFolder *lf, const char *toplevel_dir, const char *full_name);
+static char *spool_get_meta_path(CamelLocalFolder *lf, const char *toplevel_dir, const char *full_name, const char *ext);
+static CamelLocalSummary *spool_create_summary(CamelLocalFolder *lf, const char *path, const char *folder, CamelIndex *index);
static int spool_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex);
static void spool_unlock(CamelLocalFolder *lf);
@@ -68,7 +72,8 @@ camel_spool_folder_class_init(CamelSpoolFolderClass *klass)
parent_class = (CamelFolderClass *)camel_mbox_folder_get_type();
- /* virtual method overload */
+ lklass->get_full_path = spool_get_full_path;
+ lklass->get_meta_path = spool_get_meta_path;
lklass->create_summary = spool_create_summary;
lklass->lock = spool_lock;
lklass->unlock = spool_unlock;
@@ -117,7 +122,7 @@ camel_spool_folder_new(CamelStore *parent_store, const char *full_name, guint32
if (parent_store->flags & CAMEL_STORE_FILTER_INBOX
&& strcmp(full_name, "INBOX") == 0)
folder->folder_flags |= CAMEL_FOLDER_FILTER_RECENT;
- flags &= CAMEL_STORE_FOLDER_BODY_INDEX;
+ flags &= ~CAMEL_STORE_FOLDER_BODY_INDEX;
folder = (CamelFolder *)camel_local_folder_construct((CamelLocalFolder *)folder, parent_store, full_name, flags, ex);
if (folder) {
@@ -128,8 +133,32 @@ camel_spool_folder_new(CamelStore *parent_store, const char *full_name, guint32
return folder;
}
+static char *
+spool_get_full_path(CamelLocalFolder *lf, const char *toplevel_dir, const char *full_name)
+{
+ return g_strdup_printf ("%s/%s", toplevel_dir, full_name);
+}
+
+static char *
+spool_get_meta_path(CamelLocalFolder *lf, const char *toplevel_dir, const char *full_name, const char *ext)
+{
+ CamelService *service = (CamelService *)((CamelFolder *)lf)->parent_store;
+ char *root = camel_session_get_storage_path(service->session, service, NULL);
+ char *path;
+
+ if (root == NULL)
+ return NULL;
+
+
+ camel_mkdir(root, 0777);
+ path = g_strdup_printf("%s/%s%s", root, full_name, ext);
+ g_free(root);
+
+ return path;
+}
+
static CamelLocalSummary *
-spool_create_summary(const char *path, const char *folder, CamelIndex *index)
+spool_create_summary(CamelLocalFolder *lf, const char *path, const char *folder, CamelIndex *index)
{
return (CamelLocalSummary *)camel_spool_summary_new(folder);
}