From 06aa62ad092e7b94599a9b2cbf392fe731f3872d Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Thu, 27 Mar 2003 04:06:43 +0000 Subject: [ fixes bug #34651 ] strcmp -> g_utf8_collate. (update_query): encode the 2003-03-26 Chris Toshok [ fixes bug #34651 ] * gui/component/select-names/e-select-names.c (select_entry_changed): strcmp -> g_utf8_collate. (update_query): encode the string we pass for the query. svn path=/trunk/; revision=20541 --- addressbook/ChangeLog | 7 +++++++ .../gui/component/select-names/e-select-names.c | 19 +++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 11f1c1ca28..ad110a7284 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,10 @@ +2003-03-26 Chris Toshok + + [ fixes bug #34651 ] + * gui/component/select-names/e-select-names.c + (select_entry_changed): strcmp -> g_utf8_collate. + (update_query): encode the string we pass for the query. + 2003-03-26 Chris Toshok [ fixes bug #34085 ] diff --git a/addressbook/gui/component/select-names/e-select-names.c b/addressbook/gui/component/select-names/e-select-names.c index 00f4004945..7de212b8fc 100644 --- a/addressbook/gui/component/select-names/e-select-names.c +++ b/addressbook/gui/component/select-names/e-select-names.c @@ -46,6 +46,7 @@ #include #include #include +#include "e-util/e-sexp.h" static void e_select_names_init (ESelectNames *card); static void e_select_names_class_init (ESelectNamesClass *klass); @@ -354,22 +355,27 @@ update_query (GtkWidget *widget, ESelectNames *e_select_names) char *query; char *q_array[4]; int i; + GString *s = g_string_new (""); + if (e_select_names->categories) { category = e_categories_master_list_option_menu_get_category (E_CATEGORIES_MASTER_LIST_OPTION_MENU (e_select_names->categories)); } if (e_select_names->select_entry) { search = gtk_entry_get_text (GTK_ENTRY (e_select_names->select_entry)); } + + e_sexp_encode_string (s, search); + i = 0; q_array[i++] = "(contains \"email\" \"\")"; if (category && *category) q_array[i++] = g_strdup_printf ("(is \"category\" \"%s\")", category); if (search && *search) - q_array[i++] = g_strdup_printf ("(or (beginswith \"email\" \"%s\") " - " (beginswith \"full_name\" \"%s\") " - " (beginswith \"nickname\" \"%s\")" - " (beginswith \"file_as\" \"%s\"))", - search, search, search, search); + q_array[i++] = g_strdup_printf ("(or (beginswith \"email\" %s) " + " (beginswith \"full_name\" %s) " + " (beginswith \"nickname\" %s)" + " (beginswith \"file_as\" %s))", + s->str, s->str, s->str, s->str); q_array[i++] = NULL; if (i > 2) { char *temp = g_strjoinv (" ", q_array); @@ -385,6 +391,7 @@ update_query (GtkWidget *widget, ESelectNames *e_select_names) g_free (q_array[i]); } g_free (query); + g_string_free (s, TRUE); } static void @@ -423,7 +430,7 @@ select_entry_changed (GtkWidget *widget, ESelectNames *e_select_names) E_CARD_SIMPLE_FIELD_NAME_OR_ORG, model_row), -1); - if (strcmp (select_strcoll_string, row_strcoll_string) <= 0) { + if (g_utf8_collate (select_strcoll_string, row_strcoll_string) <= 0) { g_free (row_strcoll_string); break; } -- cgit