aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-07-05 11:13:52 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-07-05 11:13:52 +0800
commitbf20209bbbbab216918ff84d435a8e98e22c0601 (patch)
tree73614b4f2d20896425286912a54110b0afbfa3d3 /camel
parentdcb5ea4101ffdd79ff7849867f8c32426e88da7f (diff)
downloadgsoc2013-evolution-bf20209bbbbab216918ff84d435a8e98e22c0601.tar
gsoc2013-evolution-bf20209bbbbab216918ff84d435a8e98e22c0601.tar.gz
gsoc2013-evolution-bf20209bbbbab216918ff84d435a8e98e22c0601.tar.bz2
gsoc2013-evolution-bf20209bbbbab216918ff84d435a8e98e22c0601.tar.lz
gsoc2013-evolution-bf20209bbbbab216918ff84d435a8e98e22c0601.tar.xz
gsoc2013-evolution-bf20209bbbbab216918ff84d435a8e98e22c0601.tar.zst
gsoc2013-evolution-bf20209bbbbab216918ff84d435a8e98e22c0601.zip
When indexing a new record, create a pseudo word 'ibexindexed' so we can
2001-07-05 Not Zed <NotZed@Ximian.com> * camel-folder-summary.c (camel_folder_summary_info_new_from_message): When indexing a new record, create a pseudo word 'ibexindexed' so we can always tell that a message has already been idnexed, even if it contains no words of its own. Things like maildir use this check to see if its already been processed, and it matters if it is incorrect in this case (not just wasted cycles). (camel_folder_summary_info_new_from_parser): And same here. * providers/local/camel-maildir-summary.c (maildir_summary_sync): Changed the logicfor epoolv code to be different, we dont need to update hash references or any tricky stuff. (maildir_summary_check): Samehere. * camel-folder-summary.h: Removed include of e-memory.h. svn path=/trunk/; revision=10785
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog19
-rw-r--r--camel/camel-folder-summary.c5
-rw-r--r--camel/camel-folder-summary.h3
-rw-r--r--camel/providers/local/camel-maildir-summary.c36
4 files changed, 41 insertions, 22 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 166b0ac35b..455ba9e9ee 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,22 @@
+2001-07-05 Not Zed <NotZed@Ximian.com>
+
+ * camel-folder-summary.c
+ (camel_folder_summary_info_new_from_message): When indexing a new
+ record, create a pseudo word 'ibexindexed' so we can always tell
+ that a message has already been idnexed, even if it contains no
+ words of its own. Things like maildir use this check to see if
+ its already been processed, and it matters if it is incorrect in
+ this case (not just wasted cycles).
+
+ (camel_folder_summary_info_new_from_parser): And same here.
+
+ * providers/local/camel-maildir-summary.c (maildir_summary_sync):
+ Changed the logicfor epoolv code to be different, we dont need to
+ update hash references or any tricky stuff.
+ (maildir_summary_check): Samehere.
+
+ * camel-folder-summary.h: Removed include of e-memory.h.
+
2001-07-03 Joe Shaw <joe@ximian.com>
* providers/nntp/camel-nntp-resp-codes.h: Added NNTP_NO_PERMISSION
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index e89915326e..bd085b4b3f 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -844,6 +844,7 @@ CamelMessageInfo *camel_folder_summary_info_new_from_parser(CamelFolderSummary *
p->filter_index = camel_mime_filter_index_new_ibex(p->index);
camel_mime_filter_index_set_name(p->filter_index, (char *)camel_message_info_uid(info));
ibex_unindex(p->index, (char *)camel_message_info_uid(info));
+ ibex_index_buffer(p->index, (char *)camel_message_info_uid(info), "ibexindexed", strlen("ibexindexed"), NULL);
}
/* always scan the content info, even if we dont save it */
@@ -876,8 +877,10 @@ CamelMessageInfo *camel_folder_summary_info_new_from_message(CamelFolderSummary
* know if we are going to store this in the summary, but no matter */
summary_assign_uid(s, info);
- if (p->index)
+ if (p->index) {
ibex_unindex(p->index, (char *)camel_message_info_uid(info));
+ ibex_index_buffer(p->index, (char *)camel_message_info_uid(info), "ibexindexed", strlen("ibexindexed"), NULL);
+ }
info->content = summary_build_content_info_message(s, info, (CamelMimePart *)msg);
/* FIXME: calculate the size as part of build_content_info_message */
diff --git a/camel/camel-folder-summary.h b/camel/camel-folder-summary.h
index 6aa8e9525d..5fc675b5fd 100644
--- a/camel/camel-folder-summary.h
+++ b/camel/camel-folder-summary.h
@@ -97,7 +97,6 @@ typedef struct _CamelSummaryReferences {
#define DOEPOOLV
#if defined (DOEPOOLV) || defined (DOESTRV)
-#include "../e-util/e-memory.h"
/* string array indices */
enum {
@@ -115,7 +114,7 @@ enum {
struct _CamelMessageInfo {
/* public fields */
#ifdef DOEPOOLV
- EPoolv *strings;
+ struct _EPoolv *strings;
#elif defined (DOESTRV)
struct _EStrv *strings; /* all strings packed into a single compact array */
#else
diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c
index ee9411c297..bc7bf790bd 100644
--- a/camel/providers/local/camel-maildir-summary.c
+++ b/camel/providers/local/camel-maildir-summary.c
@@ -580,26 +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) {
-#if defined (DOEPOOLV) || defined (DOESTRV)
+#ifdef 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
+ /* need to update the summary hash ref */
+ g_hash_table_remove(s->messages_uid, camel_message_info_uid(info));
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 /* defined (DOEPOOLV) || defined (DOESTRV) */
+#else
+# ifdef DOEPOOLV
+ info->strings = e_poolv_set(info->strings, CAMEL_MAILDIR_INFO_FILENAME, d->d_name, FALSE);
+# else
g_free(mdi->filename);
mdi->filename = g_strdup(d->d_name);
-#endif
+# endif
+#endif
}
camel_folder_summary_info_free((CamelFolderSummary *)cls, info);
}
@@ -681,7 +678,7 @@ maildir_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChange
int count, i;
CamelMessageInfo *info;
CamelMaildirMessageInfo *mdi;
-#if defined (DOEPOOLV) || defined (DOESTRV)
+#ifdef DOESTRV
CamelFolderSummary *s = (CamelFolderSummary *)cls;
#endif
char *name;
@@ -732,22 +729,23 @@ 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 */
-#if defined (DOEPOOLV) || defined (DOESTRV)
+#ifdef 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 /* defined (DOEPOOLV) || defined (DOESTRV) */
+#else
+# ifdef DOEPOOLV
+ info->strings = e_poolv_set(info->strings, CAMEL_MAILDIR_INFO_FILENAME, newname, TRUE);
+ g_free(newname);
+# else
g_free(mdi->filename);
mdi->filename = newname;
+# endif
#endif
}
g_free(name);