projects
/
modest
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
14d5844
)
Filter words do AND, not OR
author
Jose Dapena Paz
<jdapena@igalia.com>
Wed, 4 Nov 2009 17:39:24 +0000
(18:39 +0100)
committer
José Dapena Paz
<jdapena@igalia.com>
Mon, 25 Jan 2010 11:45:40 +0000
(12:45 +0100)
src/widgets/modest-header-view.c
patch
|
blob
|
history
diff --git
a/src/widgets/modest-header-view.c
b/src/widgets/modest-header-view.c
index
d217a88
..
121a17d
100644
(file)
--- a/
src/widgets/modest-header-view.c
+++ b/
src/widgets/modest-header-view.c
@@
-2124,36
+2124,43
@@
current_folder_needs_filtering (ModestHeaderViewPrivate *priv)
static gboolean
header_match_string (TnyHeader *header, gchar **words)
{
static gboolean
header_match_string (TnyHeader *header, gchar **words)
{
+ gchar *subject;
+ gchar *cc;
+ gchar *bcc;
+ gchar *to;
+ gchar *from;
+
gchar **current_word;
gboolean found;
gchar **current_word;
gboolean found;
- found = FALSE;
+ subject = tny_header_dup_subject (header);
+ cc = tny_header_dup_cc (header);
+ bcc = tny_header_dup_bcc (header);
+ to = tny_header_dup_to (header);
+ from = tny_header_dup_from (header);
- for (current_word = words; !found && *current_word != NULL; current_word++) {
- gchar *subject;
- gchar *cc;
- gchar *bcc;
- gchar *to;
- gchar *from;
+ found = FALSE;
- subject = tny_header_dup_subject (header);
- cc = tny_header_dup_cc (header);
- bcc = tny_header_dup_bcc (header);
- to = tny_header_dup_to (header);
- from = tny_header_dup_from (header);
+ for (current_word = words; *current_word != NULL; current_word++) {
if ((subject && g_strstr_len (subject, -1, *current_word))
|| (cc && g_strstr_len (cc, -1, *current_word))
|| (bcc && g_strstr_len (bcc, -1, *current_word))
|| (to && g_strstr_len (to, -1, *current_word))
if ((subject && g_strstr_len (subject, -1, *current_word))
|| (cc && g_strstr_len (cc, -1, *current_word))
|| (bcc && g_strstr_len (bcc, -1, *current_word))
|| (to && g_strstr_len (to, -1, *current_word))
- || (from && g_strstr_len (from, -1, *current_word)))
+ || (from && g_strstr_len (from, -1, *current_word))) {
found = TRUE;
found = TRUE;
- g_free (subject);
- g_free (cc);
- g_free (bcc);
- g_free (to);
- g_free (from);
+ } else {
+ found = FALSE;
+ break;
+ }
}
}
+
+ g_free (subject);
+ g_free (cc);
+ g_free (bcc);
+ g_free (to);
+ g_free (from);
+
return found;
}
return found;
}