diff options
author | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-05-17 03:28:11 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-05-17 03:28:11 +0800 |
commit | b09782b47b24803e80c445ba9d3472f29b22f31a (patch) | |
tree | 6dc584ac30ad0695f4d80142e282d36c55773915 /mail/message-list.c | |
parent | c79dfb2c959016e8f54665d913de2f0dee5f387e (diff) | |
download | gsoc2013-evolution-b09782b47b24803e80c445ba9d3472f29b22f31a.tar.gz gsoc2013-evolution-b09782b47b24803e80c445ba9d3472f29b22f31a.tar.zst gsoc2013-evolution-b09782b47b24803e80c445ba9d3472f29b22f31a.zip |
Improved GMail like sorting. Expanded thread moved up the list if it has a new mail.
svn path=/trunk/; revision=33554
Diffstat (limited to 'mail/message-list.c')
-rw-r--r-- | mail/message-list.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/mail/message-list.c b/mail/message-list.c index 0d9afd2445..dee6147f88 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -1424,6 +1424,45 @@ ml_tree_value_at (ETreeModel *etm, ETreePath path, int col, void *model_data) } } +static void * +ml_tree_sort_value_at (ETreeModel *etm, ETreePath path, int col, void *model_data) +{ + MessageList *message_list = model_data; + CamelMessageInfo *msg_info; + + if (!(col == COL_SENT || col == COL_RECEIVED)) + return ml_tree_value_at (etm, path, col, model_data); + + if (e_tree_model_node_is_root (etm, path)) + return NULL; + + /* retrieve the message information array */ + msg_info = e_tree_memory_node_get_data (E_TREE_MEMORY(etm), path); + g_assert (msg_info != NULL); + + if (col == COL_SENT) { + ETreePath child; + + child = e_tree_model_node_get_first_child(etm, path); + if (child) { + return GINT_TO_POINTER (subtree_latest (message_list, child, 1)); + } + + return GINT_TO_POINTER (camel_message_info_date_sent(msg_info)); + } else if (col == COL_RECEIVED) { + ETreePath child; + + child = e_tree_model_node_get_first_child(etm, path); + if (child) { + return GINT_TO_POINTER (subtree_latest (message_list, child, 0)); + } + return GINT_TO_POINTER (camel_message_info_date_received(msg_info)); + } + + return ml_tree_value_at (etm, path, col, model_data); + +} + static void ml_tree_set_value_at (ETreeModel *etm, ETreePath path, int col, const void *val, void *model_data) @@ -2225,6 +2264,7 @@ message_list_construct (MessageList *message_list) ml_has_get_node_by_id, ml_get_node_by_id, + ml_tree_sort_value_at, ml_tree_value_at, ml_tree_set_value_at, ml_tree_is_cell_editable, |