+2009-04-24 Milan Crha <mcrha@redhat.com>
+
+ ** Part of fix for bug #571206
+
+ * camel-vee-folder.c: (camel_vee_folder_add_folder), (vee_sync):
+ * camel-vee-summary.c: (camel_vee_summary_load_check_unread_vfolder),
+ (vee_info_set_flags):
+ * camel-folder-summary.c: (camel_folder_summary_class_init):
+ Various compiler warning cleanup.
+
+ * camel-folder-summary.h: (camel_folder_summary_reload_from_db):
+ Function prototype double-declared.
+
2009-04-24 Sergio Villar Senin <svillar@igalia.com>
** Fix for bug #578822 - fixed potential invalid dereference
static void
camel_folder_summary_class_init (CamelFolderSummaryClass *klass)
{
- CamelObjectClass *camel_object_class = CAMEL_OBJECT_CLASS (klass);
camel_folder_summary_parent = camel_type_get_global_classfuncs (camel_object_get_type ());
klass->summary_header_load = summary_header_load;
void camel_folder_summary_clear(CamelFolderSummary *summary);
void camel_folder_summary_clear_db (CamelFolderSummary *s);
-int camel_folder_summary_reload_from_db (CamelFolderSummary *s, CamelException *ex);
int camel_folder_summary_cache_size (CamelFolderSummary *s);
/* lookup functions */
camel_vee_folder_add_folder(CamelVeeFolder *vf, CamelFolder *sub)
{
struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);
- int i, cache;
+ int i;
CamelVeeFolder *folder_unmatched = vf->parent_vee_store ? vf->parent_vee_store->folder_unmatched : NULL;
if (vf == (CamelVeeFolder *)sub) {
GSList *del = NULL;
for (i=0; i < count; i++) {
- CamelVeeMessageInfo *mi = camel_folder_summary_index (folder->summary, i);
+ CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *)camel_folder_summary_index (folder->summary, i);
if (mi->old_flags & CAMEL_MESSAGE_DELETED) {
del = g_slist_prepend (del, (gpointer) camel_pstring_strdup(((CamelMessageInfo *)mi)->uid));
camel_folder_summary_remove_index_fast (folder->summary, i);
static char *exp = NULL;
char *meta;
gboolean hacked_unread_folder = FALSE;
- CamelVeeFolder *vf = (CamelVeeFolder *) ((CamelFolderSummary *)vs)->folder;
+ CamelVeeFolder *vf;
+
+ g_return_if_fail (vs != NULL);
+
+ vf = (CamelVeeFolder *) ((CamelFolderSummary *)vs)->folder;
/* HACK: Ugliest of all hacks. Its virtually not possible now
* to maintain counts and the non matching uids of unread vfolder here.
printf("Expression for vfolder '%s' is '%s'\n", mi->summary->folder->full_name, g_strescape(vf->expression, ""));
if (vf->priv->unread_vfolder == -1)
- camel_vee_summary_load_check_unread_vfolder (mi->summary);
+ camel_vee_summary_load_check_unread_vfolder (CAMEL_VEE_SUMMARY (mi->summary));
if (vf->priv->unread_vfolder == 1)
hacked_unread_folder = TRUE;
+2009-04-24 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #571206
+
+ * camel-maildir-summary.c: (message_info_new_from_header):
+ Peek info from summary.
+ * camel-maildir-summary.c: (maildir_summary_check),
+ Reload summary from db if necessary.
+ * camel-maildir-store.c: (fill_fi):
+ * camel-mh-store.c: (fill_fi):
+ Use 'camel_folder_summary_header_load_from_db'.
+
+ * camel-local-summary.h: (struct _CamelLocalSummaryClass):
+ * camel-local-summary.c: (local_summary_need_index):
+ * camel-spool-summary.c: (spool_summary_need_index):
+ Declare function prototype properly.
+
2009-04-24 Sergio Villar Senin <svillar@igalia.com>
** Fixes bug #573183
static int local_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
static int local_summary_sync(CamelLocalSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
static CamelMessageInfo *local_summary_add(CamelLocalSummary *cls, CamelMimeMessage *msg, const CamelMessageInfo *info, CamelFolderChangeInfo *, CamelException *ex);
-static int local_summary_need_index();
+static int local_summary_need_index(void);
static void camel_local_summary_class_init (CamelLocalSummaryClass *klass);
static void camel_local_summary_init (CamelLocalSummary *obj);
}
static int
-local_summary_need_index() {
+local_summary_need_index(void) {
return 1;
}
char *(*encode_x_evolution)(CamelLocalSummary *cls, const CamelLocalMessageInfo *info);
int (*decode_x_evolution)(CamelLocalSummary *cls, const char *xev, CamelLocalMessageInfo *info);
- int (*need_index)();
+ int (*need_index)(void);
};
CamelType camel_local_summary_get_type (void);
path = g_strdup_printf("%s/%s.ev-summary", root, fi->full_name);
folderpath = g_strdup_printf("%s/%s", root, fi->full_name);
s = (CamelFolderSummary *)camel_maildir_summary_new(NULL, path, folderpath, NULL);
- if (camel_folder_summary_header_load(s) != -1) {
+ if (camel_folder_summary_header_load_from_db (s, store, fi->full_name, NULL) != -1) {
fi->unread = s->unread_count;
fi->total = s->saved_count;
}
mdi->info.info.uid = camel_pstring_add (camel_folder_summary_next_uid_string(s), TRUE);
/* handle 'duplicates' */
- info = camel_folder_summary_uid(s, uid);
+ info = camel_folder_summary_peek_info (s, uid);
if (info) {
d(printf("already seen uid '%s', just summarising instead\n", uid));
camel_message_info_free(mi);
/* keeps track of all uid's that have not been processed */
left = g_hash_table_new(g_str_hash, g_str_equal);
- count = camel_folder_summary_count((CamelFolderSummary *)cls);
+ count = camel_folder_summary_count (s);
+ if (count != camel_folder_summary_cache_size (s)) {
+ camel_folder_summary_reload_from_db (s, ex);
+ count = camel_folder_summary_count (s);
+ }
forceindex = count == 0;
for (i=0;i<count;i++) {
info = camel_folder_summary_index((CamelFolderSummary *)cls, i);
path = g_strdup_printf("%s/%s.ev-summary", root, fi->full_name);
folderpath = g_strdup_printf("%s/%s", root, fi->full_name);
s = (CamelFolderSummary *)camel_mh_summary_new(NULL, path, folderpath, NULL);
- if (camel_folder_summary_header_load(s) != -1) {
+ if (camel_folder_summary_header_load_from_db (s, store, fi->full_name, NULL) != -1) {
fi->unread = s->unread_count;
fi->total = s->saved_count;
}
static int spool_summary_check(CamelLocalSummary *cls, CamelFolderChangeInfo *changeinfo, CamelException *ex);
static int spool_summary_sync_full(CamelMboxSummary *cls, gboolean expunge, CamelFolderChangeInfo *changeinfo, CamelException *ex);
-static int spool_summary_need_index();
+static int spool_summary_need_index(void);
static void camel_spool_summary_class_init (CamelSpoolSummaryClass *klass);
static void camel_spool_summary_init (CamelSpoolSummary *obj);
}
static int
-spool_summary_need_index() {
+spool_summary_need_index(void) {
return 0;
}