diff options
author | Milan Crha <mcrha@redhat.com> | 2009-10-16 20:02:08 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2009-10-16 20:02:08 +0800 |
commit | 84888e0f7544b8b8cd3f45e4720694277ed5355b (patch) | |
tree | 429e94e4264d14c65f321c30741328822909a49b | |
parent | a500783aca7da027c8c1898cb5d55ebdb2c04e85 (diff) | |
download | gsoc2013-evolution-84888e0f7544b8b8cd3f45e4720694277ed5355b.tar gsoc2013-evolution-84888e0f7544b8b8cd3f45e4720694277ed5355b.tar.gz gsoc2013-evolution-84888e0f7544b8b8cd3f45e4720694277ed5355b.tar.bz2 gsoc2013-evolution-84888e0f7544b8b8cd3f45e4720694277ed5355b.tar.lz gsoc2013-evolution-84888e0f7544b8b8cd3f45e4720694277ed5355b.tar.xz gsoc2013-evolution-84888e0f7544b8b8cd3f45e4720694277ed5355b.tar.zst gsoc2013-evolution-84888e0f7544b8b8cd3f45e4720694277ed5355b.zip |
Bug #552779 - Sort order of messages by "From" is case sensitive
-rw-r--r-- | mail/message-list.c | 20 | ||||
-rw-r--r-- | mail/message-list.etspec | 6 |
2 files changed, 10 insertions, 16 deletions
diff --git a/mail/message-list.c b/mail/message-list.c index 5972447cb0..a9a49e1786 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -293,9 +293,6 @@ e_mail_address_free (EMailAddress *addr) g_free (addr); } -/* Note: by the time this function is called, the strings have already - been normalised which means we can assume all lowercase chars and - we can just use strcmp for the final comparison. */ static gint e_mail_address_compare (gconstpointer address1, gconstpointer address2) { @@ -311,7 +308,7 @@ e_mail_address_compare (gconstpointer address1, gconstpointer address2) g_return_val_if_fail (addr1->address != NULL, 1); g_return_val_if_fail (addr2->address != NULL, -1); - return strcmp (addr1->address, addr2->address); + return g_ascii_strcasecmp (addr1->address, addr2->address); } if (!addr1->wname) @@ -325,7 +322,7 @@ e_mail_address_compare (gconstpointer address1, gconstpointer address2) g_return_val_if_fail (addr1->address != NULL, 1); g_return_val_if_fail (addr2->address != NULL, -1); - return strcmp (addr1->address, addr2->address); + return g_ascii_strcasecmp (addr1->address, addr2->address); } if (!addr1->wname->last) @@ -333,31 +330,28 @@ e_mail_address_compare (gconstpointer address1, gconstpointer address2) if (!addr2->wname->last) return 1; - retval = strcmp (addr1->wname->last, addr2->wname->last); + retval = g_ascii_strcasecmp (addr1->wname->last, addr2->wname->last); if (retval) return retval; /* last names are identical - compare first names */ if (!addr1->wname->first && !addr2->wname->first) - return strcmp (addr1->address, addr2->address); + return g_ascii_strcasecmp (addr1->address, addr2->address); if (!addr1->wname->first) return -1; if (!addr2->wname->first) return 1; - retval = strcmp (addr1->wname->first, addr2->wname->first); + retval = g_ascii_strcasecmp (addr1->wname->first, addr2->wname->first); if (retval) return retval; - return strcmp (addr1->address, addr2->address); + return g_ascii_strcasecmp (addr1->address, addr2->address); } #endif /* SMART_ADDRESS_COMPARE */ -/* Note: by the time this function is called, the strings have already - been normalised which means we can assume all lowercase chars and - we can just use strcmp for the final comparison. */ static gint address_compare (gconstpointer address1, gconstpointer address2) { @@ -376,7 +370,7 @@ address_compare (gconstpointer address1, gconstpointer address2) e_mail_address_free (addr1); e_mail_address_free (addr2); #else - retval = strcmp ((gchar *) address1, (gchar *) address2); + retval = g_ascii_strcasecmp ((gchar *) address1, (gchar *) address2); #endif /* SMART_ADDRESS_COMPARE */ return retval; diff --git a/mail/message-list.etspec b/mail/message-list.etspec index c8d438b90c..d153acb297 100644 --- a/mail/message-list.etspec +++ b/mail/message-list.etspec @@ -9,7 +9,7 @@ <ETableColumn model_col="4" compare_col="20" _title="From" expansion="1.0" minimum_width="32" resizable="true" cell="render_text" compare="address_compare" search="string" priority="10"/> - <ETableColumn model_col="5" compare_col="21" _title="Subject" expansion="1.6" minimum_width="32" resizable="true" cell="render_tree" compare="string" search="string"/> + <ETableColumn model_col="5" compare_col="21" _title="Subject" expansion="1.6" minimum_width="32" resizable="true" cell="render_tree" compare="stringcase" search="string"/> <ETableColumn model_col="6" _title="Date" expansion="0.4" minimum_width="32" resizable="true" cell="render_date" compare="integer"/> @@ -31,9 +31,9 @@ <ETableColumn model_col="15" _title="Recipients" expansion="1.0" minimum_width="32" resizable="true" cell="render_text" compare="address_compare" search="string" priority="10"/> <ETableColumn model_col="16" _title="Messages" expansion="1.0" minimum_width="32" resizable="true" cell="render_composite_from" compare="address_compare" search="string" priority="10" sortable="false"/> <ETableColumn model_col="17" _title="Sent Messages" expansion="1.0" minimum_width="32" resizable="true" cell="render_composite_to" compare="address_compare" search="string" priority="10" sortable="false"/> - <ETableColumn model_col="18" _title="Labels" expansion="1.0" minimum_width="32" resizable="true" cell="render_text" compare="string" search="string" priority="10"/> + <ETableColumn model_col="18" _title="Labels" expansion="1.0" minimum_width="32" resizable="true" cell="render_text" compare="stringcase" search="string" priority="10"/> - <ETableColumn model_col="19" compare_col="21" _title="Subject - Trimmed" expansion="1.6" minimum_width="32" resizable="true" cell="render_tree" compare="string" search="string"/> + <ETableColumn model_col="19" compare_col="21" _title="Subject - Trimmed" expansion="1.6" minimum_width="32" resizable="true" cell="render_tree" compare="stringcase" search="string"/> <ETableState> <column source="0"/> <column source="3"/> <column source="1"/> |