diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2007-09-13 08:15:30 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2007-09-13 08:15:30 +0000 |
commit | 1c8ead7fa931806f3b17208afd191df27f08ffa9 (patch) | |
tree | 98af00b08d2f107277a118c669a00d10fcce5cd0 /src | |
parent | 60afaca7f0fc0eafad37b26bfd7050470da9b994 (diff) |
summaryview.c: compare using simpilfied To strings.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1898 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r-- | src/summaryview.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/summaryview.c b/src/summaryview.c index 6799dec4..32b464c7 100644 --- a/src/summaryview.c +++ b/src/summaryview.c @@ -6252,10 +6252,37 @@ static gint func_name(GtkTreeModel *model, \ } CMP_FUNC_DEF(summary_cmp_by_from, fromname) -CMP_FUNC_DEF(summary_cmp_by_to, to); #undef CMP_FUNC_DEF +static gint summary_cmp_by_to(GtkTreeModel *model, + GtkTreeIter *a, GtkTreeIter *b, + gpointer data) +{ + MsgInfo *msginfo_a = NULL, *msginfo_b = NULL; + gchar *to_a = NULL, *to_b = NULL; + gint ret; + + gtk_tree_model_get(model, a, S_COL_MSG_INFO, &msginfo_a, + S_COL_TO, &to_a, -1); + gtk_tree_model_get(model, b, S_COL_MSG_INFO, &msginfo_b, + S_COL_TO, &to_b, -1); + + if (!msginfo_a || !msginfo_b) { + g_free(to_b); + g_free(to_a); + return 0; + } + + ret = g_ascii_strcasecmp(to_a ? to_a : "", to_b ? to_b : ""); + + g_free(to_b); + g_free(to_a); + + return (ret != 0) ? ret : + (msginfo_a->date_t - msginfo_b->date_t); +} + static gint summary_cmp_by_subject(GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer data) |