diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-12-06 02:31:30 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-12-06 02:31:30 +0800 |
commit | 1d8a9f24439696b1f6a5a6aa7dfd6eb1c4ea24f8 (patch) | |
tree | 4d2e09297fde85a7711f5450bc20fa1b95ee2318 /e-util/e-util.c | |
parent | 31002ecdfa66ba10a8d12f9192fd3f95df1d68ec (diff) | |
download | gsoc2013-evolution-1d8a9f24439696b1f6a5a6aa7dfd6eb1c4ea24f8.tar.gz gsoc2013-evolution-1d8a9f24439696b1f6a5a6aa7dfd6eb1c4ea24f8.tar.zst gsoc2013-evolution-1d8a9f24439696b1f6a5a6aa7dfd6eb1c4ea24f8.zip |
Add a "collate" sort callback that uses the new g_collate_compare().
2002-12-05 Jeffrey Stedfast <fejj@ximian.com>
* e-table-extras.c (ete_init): Add a "collate" sort callback that
uses the new g_collate_compare().
2002-12-05 Jeffrey Stedfast <fejj@ximian.com>
* gal/util/e-util.c (g_str_compare): Revert back to using just
strcmp - this fixes bug #33933 but reopens bug #26355.
(g_collate_compare): New function meant to address the sorting
required by bug #26335.
svn path=/trunk/; revision=19014
Diffstat (limited to 'e-util/e-util.c')
-rw-r--r-- | e-util/e-util.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c index c425050c4e..6c50331011 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -45,27 +45,40 @@ #endif int -g_str_compare(const void *x, const void *y) +g_str_compare (const void *x, const void *y) { if (x == NULL || y == NULL) { if (x == y) return 0; else return x ? -1 : 1; - } + } + + return strcmp (x, y); +} +int +g_collate_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 (x, y); } int -g_int_compare(const void *x, const void *y) +g_int_compare (const void *x, const void *y) { - if ( GPOINTER_TO_INT(x) < GPOINTER_TO_INT(y) ) - return -1; - else if ( GPOINTER_TO_INT(x) == GPOINTER_TO_INT(y) ) - return 0; - else - return 1; + if (GPOINTER_TO_INT (x) < GPOINTER_TO_INT (y)) + return -1; + else if (GPOINTER_TO_INT (x) == GPOINTER_TO_INT (y)) + return 0; + else + return 1; } char * |