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 | |
parent | bdb103a7f2eb7eefa97543f694e4863b54399ee7 (diff) | |
download | gsoc2013-evolution-b0bbe73658c3083bfcdcca93831a88972b620f2c.tar.gz 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
-rw-r--r-- | addressbook/ChangeLog | 7 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.etspec | 2 | ||||
-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 | ||||
-rw-r--r-- | widgets/table/ChangeLog | 7 | ||||
-rw-r--r-- | widgets/table/e-table-extras.c | 1 |
7 files changed, 36 insertions, 1 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 85740ecb3a..79bbd9abb0 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,5 +1,12 @@ 2005-10-04 Devashish Sharma <sdevashish@novell.com> + * gui/widgets/e-addressbook-view.etspec: Changed the compare type for + "Organization" to stringcase. This new type has been defined for + performing case insensitive locale sensitive UTF8 string compares. + Fixes #207110. + +2005-10-04 Devashish Sharma <sdevashish@novell.com> + * gui/widgets/e-addresbook-view.etspec: Changed the compare type for "File As" to "collate", so that proper lexicographical sorting (based on users locale)is employed. Fixes #271594, #273870. diff --git a/addressbook/gui/widgets/e-addressbook-view.etspec b/addressbook/gui/widgets/e-addressbook-view.etspec index 3c85c3087c..2aba2af5b1 100644 --- a/addressbook/gui/widgets/e-addressbook-view.etspec +++ b/addressbook/gui/widgets/e-addressbook-view.etspec @@ -36,7 +36,7 @@ different and established translation for this in your language. --> <ETableColumn model_col="34" _title="TTYTDD" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/> - <ETableColumn model_col="35" _title="Organization" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/> + <ETableColumn model_col="35" _title="Organization" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="stringcase"/> <ETableColumn model_col="36" _title="Unit" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/> <ETableColumn model_col="37" _title="Office" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/> <ETableColumn model_col="38" _title="Title" expansion="1.0" minimum_width="75" resizable="true" cell="string" compare="string"/> 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, diff --git a/widgets/table/ChangeLog b/widgets/table/ChangeLog index 93a045b66e..5b9ddc0898 100644 --- a/widgets/table/ChangeLog +++ b/widgets/table/ChangeLog @@ -1,3 +1,10 @@ +2005-10-04 Devashish Sharma <sdevashish@novell.com> + + * e-table-extras.c (ete_init): Added compare type "stringcase" to + ETableExtras to comapre hash table for case insensitive strings. The + corresponding function g_str_case_compare has been added to e-util.c. + See #207110. + 2005-09-29 Tor Lillqvist <tml@novell.com> * e-table.c (e_table_load_specification) diff --git a/widgets/table/e-table-extras.c b/widgets/table/e-table-extras.c index e8529914e8..8bb4c23ae6 100644 --- a/widgets/table/e-table-extras.c +++ b/widgets/table/e-table-extras.c @@ -168,6 +168,7 @@ ete_init (ETableExtras *extras) extras->pixbufs = g_hash_table_new(g_str_hash, g_str_equal); e_table_extras_add_compare(extras, "string", g_str_compare); + e_table_extras_add_compare(extras, "stringcase", g_str_case_compare); e_table_extras_add_compare(extras, "collate", g_collate_compare); e_table_extras_add_compare(extras, "integer", g_int_compare); e_table_extras_add_compare(extras, "string-integer", e_strint_compare); |