aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog9
-rw-r--r--mail/em-folder-browser.c18
-rw-r--r--mail/em-folder-view.c2
-rw-r--r--mail/mail-ops.c4
-rw-r--r--mail/message-list.c6
5 files changed, 30 insertions, 9 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 <psankar@novell.com>
+
+ 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 <mcrha@redhat.com>
** 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 <camel/camel-file-utils.h>
#include <camel/camel-folder.h>
#include <camel/camel-folder-thread.h>
+#include <camel/camel-folder-summary.h>
#include <camel/camel-vee-folder.h>
#include <libedataserver/e-memory.h>
@@ -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)