aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/local/camel-maildir-summary.c22
-rw-r--r--camel/providers/local/camel-maildir-summary.h6
2 files changed, 18 insertions, 10 deletions
diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c
index e2ce0f4e97..5d65b02a5e 100644
--- a/camel/providers/local/camel-maildir-summary.c
+++ b/camel/providers/local/camel-maildir-summary.c
@@ -125,7 +125,7 @@ camel_maildir_summary_init (CamelMaildirSummary *o)
s->message_info_size = sizeof(CamelMaildirMessageInfo);
s->content_info_size = sizeof(CamelMaildirMessageContentInfo);
-#ifdef DOESTRV
+#if defined (DOEPOOLV) || defined (DOESTRV)
s->message_info_strings = CAMEL_MAILDIR_INFO_LAST;
#endif
@@ -310,7 +310,7 @@ static CamelMessageInfo *message_info_new(CamelFolderSummary * s, struct _header
static void message_info_free(CamelFolderSummary *s, CamelMessageInfo *mi)
{
-#ifndef DOESTRV
+#if !defined (DOEPOOLV) && !defined (DOESTRV)
CamelMaildirMessageInfo *mdi = (CamelMaildirMessageInfo *)mi;
g_free(mdi->filename);
@@ -580,19 +580,23 @@ maildir_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changes, Ca
filename = camel_maildir_info_filename(mdi);
/* TODO: only store the extension in the mdi->filename struct, not the whole lot */
if (filename == NULL || strcmp(filename, d->d_name) != 0) {
-#ifdef DOESTRV
+#if defined (DOEPOOLV) || defined (DOESTRV)
#warning "cannot modify the estrv after its been setup, for mt-safe code"
d(printf("filename changed: %s to %s\n", filename, d->d_name));
/* need to update the summary hash string reference since it might (will) change */
CAMEL_SUMMARY_LOCK(s, summary_lock);
g_hash_table_remove(s->messages_uid, uid);
+#ifdef DOEPOOLV
+ info->strings = e_poolv_set(info->strings, CAMEL_MAILDIR_INFO_FILENAME, d->d_name, FALSE);
+#else
info->strings = e_strv_set_ref(info->strings, CAMEL_MAILDIR_INFO_FILENAME, d->d_name);
/* we need to re-pack as well */
info->strings = e_strv_pack(info->strings);
+#endif /* DOEPOOLV */
g_hash_table_insert(s->messages_uid, (char *)camel_message_info_uid(info), info);
CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-#else
+#else /* defined (DOEPOOLV) || defined (DOESTRV) */
g_free(mdi->filename);
mdi->filename = g_strdup(d->d_name);
#endif
@@ -677,7 +681,7 @@ maildir_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChange
int count, i;
CamelMessageInfo *info;
CamelMaildirMessageInfo *mdi;
-#ifdef DOESTRV
+#if defined (DOEPOOLV) || defined (DOESTRV)
CamelFolderSummary *s = (CamelFolderSummary *)cls;
#endif
char *name;
@@ -728,16 +732,20 @@ maildir_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChange
/* TODO: If this is made mt-safe, then this code could be a problem, since
the estrv is being modified.
Sigh, this may mean the maildir name has to be cached another way */
-#ifdef DOESTRV
+#if defined (DOEPOOLV) || defined (DOESTRV)
#warning "cannot modify the estrv after its been setup, for mt-safe code"
CAMEL_SUMMARY_LOCK(s, summary_lock);
/* need to update the summary hash ref */
g_hash_table_remove(s->messages_uid, camel_message_info_uid(info));
+#ifdef DOEPOOLV
+ info->strings = e_poolv_set(info->strings, CAMEL_MAILDIR_INFO_FILENAME, newname, TRUE);
+#else
info->strings = e_strv_set_ref_free(info->strings, CAMEL_MAILDIR_INFO_FILENAME, newname);
info->strings = e_strv_pack(info->strings);
+#endif /* DOEPOOLV */
g_hash_table_insert(s->messages_uid, (char *)camel_message_info_uid(info), info);
CAMEL_SUMMARY_UNLOCK(s, summary_lock);
-#else
+#else /* defined (DOEPOOLV) || defined (DOESTRV) */
g_free(mdi->filename);
mdi->filename = newname;
#endif
diff --git a/camel/providers/local/camel-maildir-summary.h b/camel/providers/local/camel-maildir-summary.h
index 456492b5e5..a42692671c 100644
--- a/camel/providers/local/camel-maildir-summary.h
+++ b/camel/providers/local/camel-maildir-summary.h
@@ -37,7 +37,7 @@ typedef struct _CamelMaildirMessageContentInfo {
CamelMessageContentInfo info;
} CamelMaildirMessageContentInfo;
-#ifdef DOESTRV
+#if defined (DOEPOOLV) || defined (DOESTRV)
enum {
CAMEL_MAILDIR_INFO_FILENAME = CAMEL_MESSAGE_INFO_LAST,
CAMEL_MAILDIR_INFO_LAST,
@@ -47,7 +47,7 @@ enum {
typedef struct _CamelMaildirMessageInfo {
CamelMessageInfo info;
-#ifndef DOESTRV
+#if !defined (DOEPOOLV) && !defined (DOESTRV)
char *filename; /* maildir has this annoying status shit on the end of the filename, use this to get the real message id */
#endif
} CamelMaildirMessageInfo;
@@ -72,7 +72,7 @@ CamelMaildirSummary *camel_maildir_summary_new (const char *filename, const char
char *camel_maildir_summary_info_to_name(const CamelMessageInfo *info);
int camel_maildir_summary_name_to_info(CamelMessageInfo *info, const char *name);
-#ifdef DOESTRV
+#if defined (DOEPOOLV) || defined (DOESTRV)
#define camel_maildir_info_filename(x) camel_message_info_string((const CamelMessageInfo *)(x), CAMEL_MAILDIR_INFO_FILENAME)
#define camel_maildir_info_set_filename(x, s) camel_message_info_set_string((CamelMessageInfo *)(x), CAMEL_MAILDIR_INFO_FILENAME, s)
#else