From ed62703ead5d7696c50d89d98c419a1f2e2597b9 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Sat, 18 Aug 2001 02:28:41 +0000 Subject: call e_sexp_encode_string on the search string the user types in so it 2001-08-17 Chris Toshok * gui/component/addressbook.c (addressbook_query_changed): call e_sexp_encode_string on the search string the user types in so it doesn't break sexp parsing in the wombat. svn path=/trunk/; revision=12190 --- addressbook/ChangeLog | 6 ++++++ addressbook/gui/component/addressbook.c | 16 ++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 769c804373..467585c76c 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,9 @@ +2001-08-17 Chris Toshok + + * gui/component/addressbook.c (addressbook_query_changed): call + e_sexp_encode_string on the search string the user types in so it + doesn't break sexp parsing in the wombat. + 2001-08-17 Damon Chaplin * gui/component/addressbook.c: changed to new print icon. diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index b849f28b72..8aeeb0d032 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -22,6 +22,7 @@ #include #include "e-util/e-categories-master-list-wombat.h" +#include "e-util/e-sexp.h" #include "select-names/e-select-names.h" #include "select-names/e-select-names-manager.h" @@ -684,18 +685,20 @@ addressbook_query_changed (ESearchBar *esb, AddressbookView *view) } else { if ((search_word && strlen (search_word)) || search_type == ESB_CATEGORY) { + GString *s = g_string_new (""); + e_sexp_encode_string (s, search_word); switch (search_type) { case ESB_ANY: - search_query = g_strdup_printf ("(contains \"x-evolution-any-field\" \"%s\")", - search_word); + search_query = g_strdup_printf ("(contains \"x-evolution-any-field\" %s)", + s->str); break; case ESB_FULL_NAME: - search_query = g_strdup_printf ("(contains \"full_name\" \"%s\")", - search_word); + search_query = g_strdup_printf ("(contains \"full_name\" %s)", + s->str); break; case ESB_EMAIL: - search_query = g_strdup_printf ("(contains \"email\" \"%s\")", - search_word); + search_query = g_strdup_printf ("(contains \"email\" %s)", + s->str); break; case ESB_CATEGORY: subid = e_search_bar_get_subitem_id (esb); @@ -713,6 +716,7 @@ addressbook_query_changed (ESearchBar *esb, AddressbookView *view) search_query = g_strdup ("(contains \"full_name\" \"\")"); break; } + g_string_free (s, TRUE); } else search_query = g_strdup ("(contains \"full_name\" \"\")"); -- cgit v1.2.3