evolution r35455 - branches/gnome-2-22/mail
- From: mcrha svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution r35455 - branches/gnome-2-22/mail
- Date: Wed, 30 Apr 2008 10:53:26 +0100 (BST)
Author: mcrha
Date: Wed Apr 30 09:53:25 2008
New Revision: 35455
URL: http://svn.gnome.org/viewvc/evolution?rev=35455&view=rev
Log:
2008-04-30 Milan Crha <mcrha redhat com>
** Fix for bug #467892
* em-folder-view.c: (em_folder_view_open_selected):
Do not inherit search filters when opening messages in new window.
* message-list.c: (regen_list_exec):
If we are called from folder_changed even, then keep the actually
selected message so it will not disappear when user reads it and
it doesn't belong to actual filter anymore.
Modified:
branches/gnome-2-22/mail/ChangeLog
branches/gnome-2-22/mail/em-folder-view.c
branches/gnome-2-22/mail/message-list.c
Modified: branches/gnome-2-22/mail/em-folder-view.c
==============================================================================
--- branches/gnome-2-22/mail/em-folder-view.c (original)
+++ branches/gnome-2-22/mail/em-folder-view.c Wed Apr 30 09:53:25 2008
@@ -561,7 +561,8 @@
emmb = (EMMessageBrowser *)em_message_browser_window_new();
message_list_set_threaded(((EMFolderView *)emmb)->list, emfv->list->threaded);
- message_list_set_search(((EMFolderView *)emmb)->list, emfv->list->search);
+ /* do not inherit search filter, because it can hide actual message for some filters */
+ /*message_list_set_search(((EMFolderView *)emmb)->list, emfv->list->search);*/
em_folder_view_set_hide_deleted((EMFolderView *)emmb, emfv->hide_deleted);
/* FIXME: session needs to be passed easier than this */
em_format_set_session((EMFormat *)((EMFolderView *)emmb)->preview, ((EMFormat *)emfv->preview)->session);
Modified: branches/gnome-2-22/mail/message-list.c
==============================================================================
--- branches/gnome-2-22/mail/message-list.c (original)
+++ branches/gnome-2-22/mail/message-list.c Wed Apr 30 09:53:25 2008
@@ -3845,6 +3845,7 @@
CamelMessageInfo *info;
ETreePath cursor;
int i;
+ char *expr = NULL;
if (m->folder != m->ml->folder)
return;
@@ -3858,10 +3859,8 @@
/* if we have hidedeleted on, use a search to find it out, merge with existing search if set */
if (!camel_folder_has_search_capability(m->folder)) {
/* if we have no search capability, dont let search or hide deleted work */
- uids = camel_folder_get_uids(m->folder);
+ expr = NULL;
} else if (m->hidedel) {
- char *expr;
-
if (m->hidejunk) {
if (m->search) {
expr = alloca(strlen(m->search) + 92);
@@ -3875,23 +3874,34 @@
} else
expr = "(match-all (not (system-flag \"deleted\")))";
}
- searchuids = uids = camel_folder_search_by_expression (m->folder, expr, &m->base.ex);
} else {
- char *expr;
-
if (m->hidejunk) {
if (m->search) {
expr = alloca(strlen(m->search) + 64);
sprintf(expr, "(and (match-all (not (system-flag \"junk\")))\n %s)", m->search);
} else
expr = "(match-all (not (system-flag \"junk\")))";
- searchuids = uids = camel_folder_search_by_expression (m->folder, expr, &m->base.ex);
} else {
- if (m->search)
- searchuids = uids = camel_folder_search_by_expression (m->folder, m->search, &m->base.ex);
- else
- uids = camel_folder_get_uids (m->folder);
+ expr = m->search;
+ }
+ }
+
+ if (expr == NULL) {
+ uids = camel_folder_get_uids (m->folder);
+ } else {
+ char *tmp_expr = NULL;
+
+ /* If m->changes is not NULL, then it means we are called from folder_changed event,
+ thus we will keep the selected message to be sure it doesn't disappear because
+ it no longer belong to our search filter. */
+ if (m->changes && m->ml->search && m->ml->cursor_uid) {
+ tmp_expr = g_strdup_printf ("(or %s (match-all (uid \"%s\")))", expr, m->ml->cursor_uid);
+ expr = tmp_expr;
}
+
+ searchuids = uids = camel_folder_search_by_expression (m->folder, expr, &m->base.ex);
+
+ g_free (tmp_expr);
}
if (camel_exception_is_set (&m->base.ex))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]