[evolution/gnome-3-32] I#390 - Free form expression search for Attachment doesn't work



commit dce93de4fe089c20a476dc5a512d6ffab1cd2e98
Author: Milan Crha <mcrha redhat com>
Date:   Mon Apr 8 09:51:38 2019 +0200

    I#390 - Free form expression search for Attachment doesn't work
    
    Closes https://gitlab.gnome.org/GNOME/evolution/issues/390

 src/mail/e-mail-free-form-exp.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/mail/e-mail-free-form-exp.c b/src/mail/e-mail-free-form-exp.c
index a7b5485cc5..a347fc8bca 100644
--- a/src/mail/e-mail-free-form-exp.c
+++ b/src/mail/e-mail-free-form-exp.c
@@ -246,9 +246,14 @@ mail_ffe_flag (const gchar *word,
        camel_sexp_encode_string (encoded_word, word);
 
        for (ii = 0; ii < G_N_ELEMENTS (system_flags); ii++) {
-               if (g_ascii_strcasecmp (word, system_flags[ii]) == 0 ||
-                   g_ascii_strcasecmp (word, g_dpgettext2 (NULL, "ffe", system_flags[ii])) == 0) {
-                       sexp = g_strdup_printf ("(match-all (system-flag \"%s\"))", system_flags[ii]);
+               const gchar *flag = system_flags[ii];
+
+               if (g_ascii_strcasecmp (word, flag) == 0 ||
+                   g_ascii_strcasecmp (word, g_dpgettext2 (NULL, "ffe", flag)) == 0) {
+                       if (g_ascii_strcasecmp (flag, "Attachment") == 0)
+                               flag = "Attachments";
+
+                       sexp = g_strdup_printf ("(match-all (system-flag \"%s\"))", flag);
                        break;
                }
        }
@@ -487,7 +492,7 @@ mail_ffe_attachment (const gchar *word,
                is_neg = TRUE;
        }
 
-       return g_strdup_printf ("(match-all %s(system-flag \"Attachment\")%s)", is_neg ? "(not " : "", is_neg 
? ")" : "");
+       return g_strdup_printf ("(match-all %s(system-flag \"Attachments\")%s)", is_neg ? "(not " : "", 
is_neg ? ")" : "");
 }
 
 static const EFreeFormExpSymbol mail_ffe_symbols[] = {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]