[evolution-patches] [Calendar/Tasks]: Fix for #323042
- From: Harish Krishnaswamy <kharish novell com>
- To: evolution-patches <evolution-patches gnome org>
- Subject: [evolution-patches] [Calendar/Tasks]: Fix for #323042
- Date: Mon, 05 Dec 2005 14:05:39 +0530
hi,
Pl. find attached a fix for the bug #323042 - The bug is observable in
2.4.2 (not on 2.5.x) owing to a dependency on the fix for #207110 that
had not been committed in the stable branch.
I have also modified the original patch that was committed to the HEAD
-
renaming the g_*_compare functions in e-util so these evolution wrapper
functions are not mistaken for glib ones.
Kindly review the same.
thanks,
harish
Index: e-util/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/e-util/ChangeLog,v
retrieving revision 1.554.2.1
diff -u -p -r1.554.2.1 ChangeLog
--- e-util/ChangeLog 9 Nov 2005 11:48:29 -0000 1.554.2.1
+++ e-util/ChangeLog 5 Dec 2005 08:21:59 -0000
@@ -1,3 +1,10 @@
+2005-12-05 Harish Krishnaswamy <kharish novell com>
+
+ * e-util.[ch]: (e_str_compare), (e_collate_compare), (e_int_compare):
+ prefix the wrapper functions with e - do not use g lest it is
+ assumed to be a glib function. Modified Devasish's fix for #207110 in HEAD
+ to fix #323042 (stable branch).
+
2005-11-09 P. S. Chakravarthi <pchakravarthi novell com>
Fixes #314638
Index: e-util/e-util.c
===================================================================
RCS file: /cvs/gnome/evolution/e-util/e-util.c,v
retrieving revision 1.65
diff -u -p -r1.65 e-util.c
--- e-util/e-util.c 24 Aug 2005 03:05:59 -0000 1.65
+++ e-util/e-util.c 5 Dec 2005 08:22:00 -0000
@@ -45,7 +45,7 @@
#include "e-util-private.h"
int
-g_str_compare (const void *x, const void *y)
+e_str_compare (const void *x, const void *y)
{
if (x == NULL || y == NULL) {
if (x == y)
@@ -58,7 +58,20 @@ g_str_compare (const void *x, const void
}
int
-g_collate_compare (const void *x, const void *y)
+e_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
+e_collate_compare (const void *x, const void *y)
{
if (x == NULL || y == NULL) {
if (x == y)
@@ -71,7 +84,7 @@ g_collate_compare (const void *x, const
}
int
-g_int_compare (const void *x, const void *y)
+e_int_compare (const void *x, const void *y)
{
if (GPOINTER_TO_INT (x) < GPOINTER_TO_INT (y))
return -1;
Index: e-util/e-util.h
===================================================================
RCS file: /cvs/gnome/evolution/e-util/e-util.h,v
retrieving revision 1.56
diff -u -p -r1.56 e-util.h
--- e-util/e-util.h 17 Jun 2005 15:20:29 -0000 1.56
+++ e-util/e-util.h 5 Dec 2005 08:22:00 -0000
@@ -137,11 +137,13 @@ typedef enum {
E_FOCUS_START,
E_FOCUS_END
} EFocus;
-int g_str_compare (const void *x,
+int e_str_compare (const void *x,
const void *y);
-int g_collate_compare (const void *x,
+int e_str_case_compare (const void *x,
const void *y);
-int g_int_compare (const void *x,
+int e_collate_compare (const void *x,
+ const void *y);
+int e_int_compare (const void *x,
const void *y);
char *e_strdup_strip (const char *string);
void e_free_object_list (GList *list);
Index: widgets/table/e-table-example-2.c
===================================================================
RCS file: /cvs/gnome/evolution/widgets/table/e-table-example-2.c,v
retrieving revision 1.13
diff -u -p -r1.13 e-table-example-2.c
--- widgets/table/e-table-example-2.c 29 Apr 2005 14:16:03 -0000 1.13
+++ widgets/table/e-table-example-2.c 5 Dec 2005 08:22:00 -0000
@@ -296,7 +296,7 @@ create_table ()
ETableCol *ecol = e_table_col_new (
i, headers [i],
1.0, 20, cell_left_just,
- g_str_compare, TRUE);
+ e_str_compare, TRUE);
/* Add it to the header. */
e_table_header_add_column (e_table_header, ecol, i);
}
@@ -305,7 +305,7 @@ create_table ()
cell_checkbox = e_cell_checkbox_new ();
pixbuf = gdk_pixbuf_new_from_file ("clip.png");
- ecol = e_table_col_new_with_pixbuf (i, pixbuf, 0.0, 18, cell_checkbox, g_int_compare, TRUE);
+ ecol = e_table_col_new_with_pixbuf (i, pixbuf, 0.0, 18, cell_checkbox, e_int_compare, TRUE);
e_table_header_add_column (e_table_header, ecol, i);
/*
Index: widgets/table/e-table-extras.c
===================================================================
RCS file: /cvs/gnome/evolution/widgets/table/e-table-extras.c,v
retrieving revision 1.19
diff -u -p -r1.19 e-table-extras.c
--- widgets/table/e-table-extras.c 17 Jun 2005 15:20:34 -0000 1.19
+++ widgets/table/e-table-extras.c 5 Dec 2005 08:22:00 -0000
@@ -108,7 +108,7 @@ e_strint_compare(gconstpointer data1, gc
int int1 = atoi(data1);
int int2 = atoi(data2);
- return g_int_compare(GINT_TO_POINTER(int1), GINT_TO_POINTER(int2));
+ return e_int_compare(GINT_TO_POINTER(int1), GINT_TO_POINTER(int2));
}
/* UTF-8 strncasecmp - not optimized */
@@ -167,9 +167,9 @@ ete_init (ETableExtras *extras)
extras->searches = g_hash_table_new(g_str_hash, g_str_equal);
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, "collate", g_collate_compare);
- e_table_extras_add_compare(extras, "integer", g_int_compare);
+ e_table_extras_add_compare(extras, "string", e_str_compare);
+ e_table_extras_add_compare(extras, "collate", e_collate_compare);
+ e_table_extras_add_compare(extras, "integer", e_int_compare);
e_table_extras_add_compare(extras, "string-integer", e_strint_compare);
e_table_extras_add_search(extras, "string", e_string_search);
Index: widgets/table/e-table-size-test.c
===================================================================
RCS file: /cvs/gnome/evolution/widgets/table/e-table-size-test.c,v
retrieving revision 1.12
diff -u -p -r1.12 e-table-size-test.c
--- widgets/table/e-table-size-test.c 31 Oct 2002 21:30:42 -0000 1.12
+++ widgets/table/e-table-size-test.c 5 Dec 2005 08:22:00 -0000
@@ -254,7 +254,7 @@ create_table (void)
ETableCol *ecol = e_table_col_new (
i, headers [i],
1.0, 20, cell_left_just,
- g_str_compare, TRUE);
+ e_str_compare, TRUE);
/* Add it to the header. */
e_table_header_add_column (e_table_header, ecol, i);
}
Index: widgets/table/test-check.c
===================================================================
RCS file: /cvs/gnome/evolution/widgets/table/test-check.c,v
retrieving revision 1.30
diff -u -p -r1.30 test-check.c
--- widgets/table/test-check.c 23 Jun 2005 09:11:10 -0000 1.30
+++ widgets/table/test-check.c 5 Dec 2005 08:22:00 -0000
@@ -183,11 +183,11 @@ check_test (void)
cell_image_check = e_cell_checkbox_new ();
pixbuf = gdk_pixbuf_new_from_file ("clip.png");
- col_0 = e_table_col_new_with_pixbuf (0, pixbuf, 0.0, 18, cell_image_check, g_int_compare, TRUE);
+ col_0 = e_table_col_new_with_pixbuf (0, pixbuf, 0.0, 18, cell_image_check, e_int_compare, TRUE);
gdk_pixbuf_unref (pixbuf);
e_table_header_add_column (e_table_header, col_0, 0);
- col_1 = e_table_col_new (1, "Item Name", 1.0, 20, cell_left_just, g_str_compare, TRUE);
+ col_1 = e_table_col_new (1, "Item Name", 1.0, 20, cell_left_just, e_str_compare, TRUE);
e_table_header_add_column (e_table_header, col_1, 1);
e_table_col_set_arrow (col_1, E_TABLE_COL_ARROW_DOWN);
Index: widgets/table/test-cols.c
===================================================================
RCS file: /cvs/gnome/evolution/widgets/table/test-cols.c,v
retrieving revision 1.28
diff -u -p -r1.28 test-cols.c
--- widgets/table/test-cols.c 23 Jun 2005 09:11:10 -0000 1.28
+++ widgets/table/test-cols.c 5 Dec 2005 08:22:00 -0000
@@ -196,10 +196,10 @@ multi_cols_test (void)
g_free (images);
}
- col_1 = e_table_col_new (1, "Item Name", 1.0, 20, cell_left_just, g_str_compare, TRUE);
+ col_1 = e_table_col_new (1, "Item Name", 1.0, 20, cell_left_just, e_str_compare, TRUE);
e_table_header_add_column (e_table_header, col_1, 0);
- col_0 = e_table_col_new (0, "A", 0.0, 48, cell_image_toggle, g_int_compare, TRUE);
+ col_0 = e_table_col_new (0, "A", 0.0, 48, cell_image_toggle, e_int_compare, TRUE);
e_table_header_add_column (e_table_header, col_0, 1);
/*
Index: widgets/table/test-table.c
===================================================================
RCS file: /cvs/gnome/evolution/widgets/table/test-table.c,v
retrieving revision 1.41
diff -u -p -r1.41 test-table.c
--- widgets/table/test-table.c 23 Jun 2005 09:11:10 -0000 1.41
+++ widgets/table/test-table.c 5 Dec 2005 08:22:00 -0000
@@ -293,7 +293,7 @@ table_browser_test (void)
ETableCol *ecol = e_table_col_new (
i, column_labels [i],
1.0, 20, cell_left_just,
- g_str_compare, TRUE,
+ e_str_compare, TRUE,
priority);
e_table_header_add_column (e_table_header, ecol, i);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]