From 40085e043615d8f1cdb583d014d774724e15d9b3 Mon Sep 17 00:00:00 2001 From: Sankarasivasubramanian Pasupathilingam Date: Wed, 16 Jul 2008 11:41:04 +0000 Subject: Pushing changes from the madagascar branch related to the on-disk summary work. svn path=/trunk/; revision=35747 --- mail/ChangeLog | 9 +++++++++ mail/em-folder-browser.c | 18 ++++++++++++------ mail/em-folder-view.c | 2 +- mail/mail-ops.c | 4 ++-- mail/message-list.c | 6 ++++++ plugins/itip-formatter/ChangeLog | 6 ++++++ plugins/itip-formatter/itip-formatter.c | 2 +- 7 files changed, 37 insertions(+), 10 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 0c5bc2e60c..7a1af5aab8 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,12 @@ +2008-07-16 Sankar P + + Pushing disk summary changes from the madagascar branch + + * em-folder-browser.c (get_view_query): + * em-folder-view.c (emfv_enable_menus): + * mail-ops.c (refresh_folder_exec): + * message-list.c (regen_list_exec): + 2008-07-09 Milan Crha ** Fix for bug #207802 (Patch suggested by Veerapuram Varadhan.) diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c index ce17ea2f54..6c4e959e02 100644 --- a/mail/em-folder-browser.c +++ b/mail/em-folder-browser.c @@ -873,11 +873,15 @@ get_view_query (ESearchBar *esb, CamelFolder *folder, const char *folder_uri) view_sexp = " "; break; + /* README: All the sexp below are not rocket science but it is not straightforward as well. + I believe it is better to document the assumptions and the conventions followed for the sexp, + before I forget so that no one else again needs to read through the code -- Sankar */ + case VIEW_UNREAD_MESSAGES: - view_sexp = "(match-all (not (system-flag \"Seen\")))"; + view_sexp = "(match-all (system-flag \"Seen\"))"; break; case VIEW_READ_MESSAGES: - view_sexp = "(match-all (system-flag \"Seen\"))"; + view_sexp = "(match-all (system-flag \"Seen\" \"set\"))"; break; case VIEW_RECENT_MESSAGES: if (!em_utils_folder_is_sent (folder, folder_uri)) @@ -892,10 +896,10 @@ get_view_query (ESearchBar *esb, CamelFolder *folder, const char *folder_uri) view_sexp = " (match-all (> (get-sent-date) (- (get-current-date) 432000)))"; break; case VIEW_WITH_ATTACHMENTS: - view_sexp = "(match-all (system-flag \"Attachments\"))"; + view_sexp = "(match-all (system-flag \"Attachments\" \"set\"))"; break; case VIEW_NOT_JUNK: - view_sexp = "(match-all (not (system-flag \"junk\")))"; + view_sexp = "(match-all (system-flag \"junk\"))"; break; case VIEW_NO_LABEL: { GSList *l; @@ -911,6 +915,8 @@ get_view_query (ESearchBar *esb, CamelFolder *folder, const char *folder_uri) tag += 6; g_string_append_printf (s, " (match-all (not (or (= (user-tag \"label\") \"%s\") (user-flag \"$Label%s\") (user-flag \"%s\"))))", tag, tag, tag); + /* FIXME: I dont see a way of mapping this kind of sexp into sql atm. I guess this option could be kicked out */ + /* May be we should copy what I did for system flags -- Sankar */ } } @@ -921,11 +927,11 @@ get_view_query (ESearchBar *esb, CamelFolder *folder, const char *folder_uri) } break; case VIEW_LABEL: tag = (char *)g_object_get_data (G_OBJECT (menu_item), "LabelTag"); - view_sexp = g_strdup_printf ("(match-all (or (= (user-tag \"label\") \"%s\") (user-flag \"$Label%s\") (user-flag \"%s\")))", tag, tag, tag); + view_sexp = g_strdup_printf ("(match-all (and (and (user-tag \"label\" \"%s\")) (or (user-flag \"$Label%s\")) (or (user-flag \"%s\"))))", tag, tag, tag); duplicate = FALSE; break; case VIEW_MESSAGES_MARKED_AS_IMPORTANT: - view_sexp = "(match-all (system-flag \"Flagged\"))"; + view_sexp = "(match-all (system-flag \"Flagged\" \"set\"))"; break; case VIEW_ANY_FIELD_CONTAINS: break; diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index c5e6d1047a..b7f911ad9d 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -2172,7 +2172,7 @@ emfv_enable_menus(EMFolderView *emfv) return; { - if (emfv->menu) { + if (emfv->menu && emfv->folder) { EMMenuTargetSelect *t; t = em_menu_target_new_select(emfv->menu, emfv->folder, emfv->folder_uri, message_list_get_selected(emfv->list)); diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 7b3fd70551..4f38a11afb 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -1620,9 +1620,9 @@ refresh_folder_desc (struct _sync_folder_msg *m) static void refresh_folder_exec (struct _sync_folder_msg *m) { - camel_folder_sync (m->folder, FALSE, &m->base.ex); + //camel_folder_sync (m->folder, FALSE, &m->base.ex); - if (!camel_exception_is_set (&m->base.ex)) + //if (!camel_exception_is_set (&m->base.ex)) camel_folder_refresh_info(m->folder, &m->base.ex); } diff --git a/mail/message-list.c b/mail/message-list.c index 8fd0ea8092..ffa00bc927 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -4062,6 +4063,7 @@ regen_list_exec (struct _regen_list_msg *m) e_profile_event_emit("list.threaduids", m->folder->full_name, 0); + //camel_folder_summary_reload_from_db (m->folder->summary, NULL); if (!camel_operation_cancel_check(m->base.cancel)) { /* update/build a new tree */ if (m->dotree) { @@ -4071,6 +4073,10 @@ regen_list_exec (struct _regen_list_msg *m) m->tree = camel_folder_thread_messages_new (m->folder, showuids, m->thread_subject); } else { m->summary = g_ptr_array_new (); + if (showuids->len != camel_folder_summary_cache_size (m->folder->summary) ) { + CamelException ex; + camel_folder_summary_reload_from_db (m->folder->summary, &ex); + } for (i = 0; i < showuids->len; i++) { info = camel_folder_get_message_info (m->folder, showuids->pdata[i]); if (info) diff --git a/plugins/itip-formatter/ChangeLog b/plugins/itip-formatter/ChangeLog index fbcd25aa96..0f987b36d0 100644 --- a/plugins/itip-formatter/ChangeLog +++ b/plugins/itip-formatter/ChangeLog @@ -1,3 +1,9 @@ +2008-07-16 Sankar P + + Pushing disk summary changes from the madagascar branch + + * itip-formatter.c (view_response_cb): + 2008-05-29 Milan Crha ** Fix for bug #535459 diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 5447ac3537..d44493df91 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -1741,7 +1741,7 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) } camel_message_info_free (mi); } - camel_folder_summary_array_free (pitip->folder->summary, summary_array); + camel_folder_free_summary (pitip->folder, summary_array); } } else { /* Either not a recurring appointment or "apply-to-all" is not selected. So just delete this instance alone */ -- cgit v1.2.3