Author: PeterB Date: Mon Feb 18 01:47:25 2008 New Revision: 7857 URL: http://svn.gnome.org/viewvc/balsa?rev=7857&view=rev
Log: avoid unnecessary filter updates Modified: trunk/ChangeLog trunk/libbalsa/filter-funcs.c trunk/libbalsa/mailbox.c Modified: trunk/libbalsa/filter-funcs.c ============================================================================== --- trunk/libbalsa/filter-funcs.c (original) +++ trunk/libbalsa/filter-funcs.c Mon Feb 18 01:47:25 2008 @@ -481,12 +481,17 @@ /* Helper to compare conditions, a bit obscure at first glance but we have to compare complex structure, so we must check all fields. + NULL conditions are OK, and compare equal only if both are NULL. */ gboolean libbalsa_condition_compare(LibBalsaCondition *c1,LibBalsaCondition *c2) { gboolean res = FALSE; + + if (c1 == NULL || c2 == NULL) + return c1 == c2; + switch (c1->type) { case CONDITION_STRING: res = (c2->type == CONDITION_STRING || Modified: trunk/libbalsa/mailbox.c ============================================================================== --- trunk/libbalsa/mailbox.c (original) +++ trunk/libbalsa/mailbox.c Mon Feb 18 01:47:25 2008 @@ -35,6 +35,7 @@ #include "mailbox-filter.h" #include "message.h" #include "misc.h" +#include "filter-funcs.h" #include "libbalsa_private.h" #include <glib/gi18n.h> @@ -2001,10 +2002,13 @@ LibBalsaCondition *cond, gboolean update_immediately) { - gboolean retval = update_immediately; + gboolean retval = FALSE; libbalsa_lock_mailbox(mailbox); + if (libbalsa_condition_compare(mailbox->view_filter, cond)) + update_immediately = FALSE; + libbalsa_condition_unref(mailbox->view_filter); mailbox->view_filter = libbalsa_condition_ref(cond); _______________________________________________ SVN-commits-list mailing list (read only) http://mail.gnome.org/mailman/listinfo/svn-commits-list Want to limit the commits to a few modules? Go to above URL, log in to edit your options and select the modules ('topics') you want. Module maintainer? It is possible to set the reply-to to your development mailing list. Email [EMAIL PROTECTED] if interested.