evolution r35596 - in branches/gnome-2-22: mail widgets/misc
- From: mcrha svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution r35596 - in branches/gnome-2-22: mail widgets/misc
- Date: Wed, 4 Jun 2008 14:37:01 +0000 (UTC)
Author: mcrha
Date: Wed Jun 4 14:37:00 2008
New Revision: 35596
URL: http://svn.gnome.org/viewvc/evolution?rev=35596&view=rev
Log:
2008-06-04 Milan Crha <mcrha redhat com>
** Fix for bug #535749
* widgets/misc/e-filter-bar.c: (get_property): Do not return any query
with empty text from search bar.
* mail/em-folder-browser.c: (get_view_query):
Distinguish between no filter and custom filter.
* mail/message-list.c: (mail_regen_list): Report empty search as NULL.
* mail/message-list.c: (regen_list_exec): Use better condition whether
keep cursor_uid in the message list or not on regeneration.
Modified:
branches/gnome-2-22/mail/ChangeLog
branches/gnome-2-22/mail/em-folder-browser.c
branches/gnome-2-22/mail/message-list.c
branches/gnome-2-22/widgets/misc/ChangeLog
branches/gnome-2-22/widgets/misc/e-filter-bar.c
Modified: branches/gnome-2-22/mail/em-folder-browser.c
==============================================================================
--- branches/gnome-2-22/mail/em-folder-browser.c (original)
+++ branches/gnome-2-22/mail/em-folder-browser.c Wed Jun 4 14:37:00 2008
@@ -847,6 +847,7 @@
switch (id & VIEW_ITEMS_MASK) {
case VIEW_ALL_MESSAGES:
+ /* one space indicates no filtering */
view_sexp = " ";
break;
@@ -908,7 +909,8 @@
break;
case VIEW_CUSTOMIZE:
- view_sexp = " ";
+ /* one space indicates no filtering, so here use two */
+ view_sexp = " ";
break;
}
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 Jun 4 14:37:00 2008
@@ -3889,19 +3889,31 @@
if (expr == NULL) {
uids = camel_folder_get_uids (m->folder);
} else {
- char *tmp_expr = NULL;
+ searchuids = uids = camel_folder_search_by_expression (m->folder, expr, &m->base.ex);
/* 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;
- }
+ if (m->changes && m->ml->search && m->ml->cursor_uid && uids) {
+ for (i = 0; i < uids->len; i++) {
+ if (g_str_equal (m->ml->cursor_uid, uids->pdata [i]))
+ break;
+ }
- searchuids = uids = camel_folder_search_by_expression (m->folder, expr, &m->base.ex);
+ /* cursor_uid has been filtered out */
+ if (i == uids->len) {
+ gboolean was_deleted = (camel_folder_get_message_flags (m->folder, m->ml->cursor_uid) & CAMEL_MESSAGE_DELETED) != 0;
+
+ /* I would really like to check for CAMEL_MESSAGE_FOLDER_FLAGGED on a message,
+ so I would know whether it was changed locally, and then just check the changes
+ struct whether change came from the server, but with periodical save it doesn't
+ matter. So here just check whether the file was deleted and we show it based
+ on the flag whether we can view deleted messages or not. */
- g_free (tmp_expr);
+ if (!was_deleted || (was_deleted && !m->hidedel))
+ g_ptr_array_add (uids, g_strdup (m->ml->cursor_uid));
+ }
+ }
}
if (camel_exception_is_set (&m->base.ex))
@@ -4182,6 +4194,10 @@
struct _regen_list_msg *m;
GConfClient *gconf;
+ /* report empty search as NULL, not as one/two-space string */
+ if (search && (strcmp (search, " ") == 0 || strcmp (search, " ") == 0))
+ search = NULL;
+
if (ml->folder == NULL) {
if (ml->search != search) {
g_free(ml->search);
Modified: branches/gnome-2-22/widgets/misc/e-filter-bar.c
==============================================================================
--- branches/gnome-2-22/widgets/misc/e-filter-bar.c (original)
+++ branches/gnome-2-22/widgets/misc/e-filter-bar.c Wed Jun 4 14:37:00 2008
@@ -592,8 +592,11 @@
ESearchBar *esb = E_SEARCH_BAR (object);
switch (property_id) {
- case PROP_QUERY:
- if (efb->current_query) {
+ case PROP_QUERY: {
+ char *text = e_search_bar_get_text (E_SEARCH_BAR (efb));
+
+ /* empty search text means searching turned off */
+ if (efb->current_query && text && *text) {
GString *out = g_string_new ("");
filter_rule_build_code (efb->current_query, out);
@@ -602,7 +605,9 @@
} else {
g_value_set_string (value, NULL);
}
- break;
+
+ g_free (text);
+ break; }
case PROP_STATE: {
/* FIXME: we should have ESearchBar save its own state to the xmlDocPtr */
xmlChar *xmlbuf;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]