fix bug [ 659054 ] incorrect sorting of 'From' column
authorPaul Mangan <paul@claws-mail.org>
Sun, 29 Dec 2002 00:50:48 +0000 (00:50 +0000)
committerPaul Mangan <paul@claws-mail.org>
Sun, 29 Dec 2002 00:50:48 +0000 (00:50 +0000)
ChangeLog.claws
configure.in
src/summaryview.c

index 74e59bea9379c0a017fa69fec21342475cc2eb70..d4ee3414a1df3f861f5f4e6311d26684e924a2a8 100644 (file)
@@ -1,3 +1,10 @@
+2002-12-29 [paul]      0.8.8claws19
+
+       * src/summaryview.c
+               fix bug [ 659054 ] incorrect sorting of 'From' column
+               when using 'display sender using address book'
+               thanks to Alfons and Luke Plant
+
 2002-12-29 [christoph] 0.8.8claws18
 
        * src/folder.c
index 4b1f51c159e964196e88946c20f9b0e85f3cca04..62b790a633edca6aeaaca4cf5bf76569bd8930f2 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws18
+EXTRA_VERSION=claws19
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index ae3badced56a3acc622627bea8829f651b3eb752..bf711a5fa6cf68ffa8ad2ffc572af59a4c7c1c64 100644 (file)
@@ -5052,13 +5052,34 @@ static gint func_name(GtkCList *clist,                                   \
        return strcasecmp(msginfo1->var_name, msginfo2->var_name);       \
 }
 
-CMP_FUNC_DEF(summary_cmp_by_from, fromname)
 CMP_FUNC_DEF(summary_cmp_by_subject, subject);
 CMP_FUNC_DEF(summary_cmp_by_to, to);
 
 #undef CMP_FUNC_DEF
 
-static gint summary_cmp_by_simplified_subject
+ static gint summary_cmp_by_from(GtkCList *clist, gconstpointer ptr1,
+                                gconstpointer ptr2)
+ {
+       const gchar *str1, *str2;
+       const GtkCListRow *r1 = (const GtkCListRow *) ptr1;
+       const GtkCListRow *r2 = (const GtkCListRow *) ptr2;
+       const SummaryView *sv = gtk_object_get_data(GTK_OBJECT(clist), "summaryview");
+       
+       g_return_val_if_fail(sv, -1);
+       
+       str1 = GTK_CELL_TEXT(r1->cell[sv->col_pos[S_COL_FROM]])->text;
+       str2 = GTK_CELL_TEXT(r2->cell[sv->col_pos[S_COL_FROM]])->text;
+
+       if (!str1)
+               return str2 != NULL;
+       if (!str2)
+               return -1;
+       return strcasecmp(str1, str2);
+ }
+ static gint summary_cmp_by_simplified_subject
        (GtkCList *clist, gconstpointer ptr1, gconstpointer ptr2)
 {
        const PrefsFolderItem *prefs;