[evolution-patches] [addressbook] Patch for a bug in "By Company" view (case sensitive grouping)



Hi,

Changed the compare type for Organization to stringcase. This new type
has been defined for performing case insensitive string compares. It
solves the problem where contacts with organization as Novell and novell
were grouped in different groups when grouped by organization. The same
can be done for other fields which require case insensitive compares. 
Fixes some bug, can't get the bug id.

Thanks
Devashish
Index: e-util/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/e-util/ChangeLog,v
retrieving revision 1.554
diff -u -p -r1.554 ChangeLog
--- e-util/ChangeLog	24 Aug 2005 03:05:59 -0000	1.554
+++ e-util/ChangeLog	26 Aug 2005 06:51:57 -0000
@@ -1,3 +1,8 @@
+2005-08-26  Devashish Sharma <sdevashish novell com>
+
+	* e-util.c (g_str_case_compare): added a function for case insensitive
+	string compare.
+
 2005-08-23  Not Zed  <NotZed Ximian com>
 
 	* e-util.c (e_mkdir_hier): cast warning, good ol win32 patches.
Index: e-util/e-util.c
===================================================================
RCS file: /cvs/gnome/evolution/e-util/e-util.c,v
retrieving revision 1.64
diff -u -p -r1.64 e-util.c
--- e-util/e-util.c	17 Jun 2005 15:20:29 -0000	1.64
+++ e-util/e-util.c	26 Aug 2005 06:51:58 -0000
@@ -57,6 +57,18 @@ g_str_compare (const void *x, const void
 	return strcmp (x, y);
 }
 
+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 strcasecmp (x, y);
+}
+
 int
 g_collate_compare (const void *x, const void *y)
 {
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	26 Aug 2005 06:51:58 -0000
@@ -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,
Index: widgets/table/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/widgets/table/ChangeLog,v
retrieving revision 1.6
diff -u -p -r1.6 ChangeLog
--- widgets/table/ChangeLog	25 Aug 2005 06:54:58 -0000	1.6
+++ widgets/table/ChangeLog	26 Aug 2005 06:52:50 -0000
@@ -1,3 +1,9 @@
+2005-08-26  Devashish Sharma <sdevashish novell com>
+
+	* e-table-extras.c (ete_init): Added compare type "stringcase" to ETableExtras->
+	compares hash table for case insensitive string compares.The
+	corresponding function g_str_case_compare has been added to e-util.c
+	
 2005-08-24  Li Yuan  <li yuan sun com>
 
 	Fixes #314352.
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	26 Aug 2005 06:52:50 -0000
@@ -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);
Index: addressbook/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/ChangeLog,v
retrieving revision 1.1990
diff -u -p -r1.1990 ChangeLog
--- addressbook/ChangeLog	26 Aug 2005 05:39:33 -0000	1.1990
+++ addressbook/ChangeLog	13 Sep 2005 10:02:25 -0000
@@ -1,5 +1,14 @@
 2005-08-26  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 string compares. It solves the problem
+	where contacts with organization as Novell and novell were grouped in
+	different groups when grouped by organization. The same can be done
+	for other fields which require case insensitive compares.
+
+2005-08-26  Devashish Sharma <sdevashish novell com>
+
 	* gui/widgets/e-addressbook-view.etspec: In ETableSpecification source
 	column and field name were not in proper order. Because of this all the
 	values in view by phone list and view by company were shown in wrong
Index: addressbook/gui/widgets/e-addressbook-view.etspec
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/widgets/e-addressbook-view.etspec,v
retrieving revision 1.7
diff -u -p -r1.7 e-addressbook-view.etspec
--- addressbook/gui/widgets/e-addressbook-view.etspec	26 Aug 2005 05:39:36 -0000	1.7
+++ addressbook/gui/widgets/e-addressbook-view.etspec	26 Aug 2005 07:01:44 -0000
@@ -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"/>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]