diff options
author | Sushma Rai <rsushma@src.gnome.org> | 2005-10-04 21:06:08 +0800 |
---|---|---|
committer | Sushma Rai <rsushma@src.gnome.org> | 2005-10-04 21:06:08 +0800 |
commit | b0bbe73658c3083bfcdcca93831a88972b620f2c (patch) | |
tree | 9a2ad005c5166f38a50715ae3be58097912f177e /e-util | |
parent | bdb103a7f2eb7eefa97543f694e4863b54399ee7 (diff) | |
download | gsoc2013-evolution-b0bbe73658c3083bfcdcca93831a88972b620f2c.tar gsoc2013-evolution-b0bbe73658c3083bfcdcca93831a88972b620f2c.tar.gz gsoc2013-evolution-b0bbe73658c3083bfcdcca93831a88972b620f2c.tar.bz2 gsoc2013-evolution-b0bbe73658c3083bfcdcca93831a88972b620f2c.tar.lz gsoc2013-evolution-b0bbe73658c3083bfcdcca93831a88972b620f2c.tar.xz gsoc2013-evolution-b0bbe73658c3083bfcdcca93831a88972b620f2c.tar.zst gsoc2013-evolution-b0bbe73658c3083bfcdcca93831a88972b620f2c.zip |
dded case insensitive compare support etable, and using it for Organization
filed. Fixes #207110. Patch submitted by
"Devashish Sharma <sdevashish@novell.com>"
svn path=/trunk/; revision=30489
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/ChangeLog | 5 | ||||
-rw-r--r-- | e-util/e-util.c | 13 | ||||
-rw-r--r-- | e-util/e-util.h | 2 |
3 files changed, 20 insertions, 0 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 3aa33477a0..f8c63cea64 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,8 @@ +2005-10-04 Devashish Sharma <sdevashish@novell.com> + + * e-util.c (g_str_case_compare): added a function for case insensitive + and locale sensitive UTF8 string compare. See #207110. + 2005-09-28 Tor Lillqvist <tml@novell.com> * e-html-utils.c (e_text_to_html_full): Use g_ascii_strncasecmp() diff --git a/e-util/e-util.c b/e-util/e-util.c index 7a9f81d81b..bf4fe6292b 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -58,6 +58,19 @@ g_str_compare (const void *x, const void *y) } int +g_str_case_compare (const void *x, const void *y) +{ + if (x == NULL || y == NULL) { + if (x == y) + return 0; + else + return x ? -1 : 1; + } + + return g_utf8_collate (g_utf8_casefold (x, -1), g_utf8_casefold (y, -1)); +} + +int g_collate_compare (const void *x, const void *y) { if (x == NULL || y == NULL) { diff --git a/e-util/e-util.h b/e-util/e-util.h index 6fe75746c2..d665a67052 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -139,6 +139,8 @@ typedef enum { } EFocus; int g_str_compare (const void *x, const void *y); +int g_str_case_compare (const void *x, + const void *y); int g_collate_compare (const void *x, const void *y); int g_int_compare (const void *x, |