aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2007-10-26 15:24:57 +0800
committerMilan Crha <mcrha@src.gnome.org>2007-10-26 15:24:57 +0800
commited049190958ff94c9b94637bc44447668a821d85 (patch)
tree6e6c37caf7556e3f299fc3300adb8eb5b8106442
parent88937e0e64c91cbaee85cc111feb3634b4c84e0c (diff)
downloadgsoc2013-evolution-ed049190958ff94c9b94637bc44447668a821d85.tar
gsoc2013-evolution-ed049190958ff94c9b94637bc44447668a821d85.tar.gz
gsoc2013-evolution-ed049190958ff94c9b94637bc44447668a821d85.tar.bz2
gsoc2013-evolution-ed049190958ff94c9b94637bc44447668a821d85.tar.lz
gsoc2013-evolution-ed049190958ff94c9b94637bc44447668a821d85.tar.xz
gsoc2013-evolution-ed049190958ff94c9b94637bc44447668a821d85.tar.zst
gsoc2013-evolution-ed049190958ff94c9b94637bc44447668a821d85.zip
** Fix for bug #489027
2007-10-26 Milan Crha <mcrha@redhat.com> ** Fix for bug #489027 * evolution-mail.schemas.in: New hidden option 'thread_latest' to fall back to thread sorting like before 2007-05-17 (see below). * message-list.c: (struct _MessageListPrivate), (message_list_construct): New property 'thread_latest'. * message-list.c: (ml_tree_sort_value_at): Sort based on this property. svn path=/trunk/; revision=34426
-rw-r--r--mail/ChangeLog10
-rw-r--r--mail/evolution-mail.schemas.in16
-rw-r--r--mail/message-list.c30
3 files changed, 46 insertions, 10 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index b6b9c29526..46f79d43f5 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,13 @@
+2007-10-26 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #489027
+
+ * evolution-mail.schemas.in: New hidden option 'thread_latest' to fall
+ back to thread sorting like before 2007-05-17 (see below).
+ * message-list.c: (struct _MessageListPrivate),
+ (message_list_construct): New property 'thread_latest'.
+ * message-list.c: (ml_tree_sort_value_at): Sort based on this property.
+
2007-10-24 Milan Crha <mcrha@redhat.com>
** Fix for bug #467364 by Christian Kintner
diff --git a/mail/evolution-mail.schemas.in b/mail/evolution-mail.schemas.in
index ebfc32823d..56e9fcc342 100644
--- a/mail/evolution-mail.schemas.in
+++ b/mail/evolution-mail.schemas.in
@@ -602,6 +602,22 @@
</locale>
</schema>
+ <schema>
+ <key>/schemas/apps/evolution/mail/display/thread_latest</key>
+ <applyto>/apps/evolution/mail/display/thread_latest</applyto>
+ <owner>evolution-mail</owner>
+ <type>bool</type>
+ <default>true</default>
+ <locale name="C">
+ <short>Whether sort threads based on latest message in that thread</short>
+ <long>
+ This setting specifies whether the threads should be sorted based
+ on latest message in each thread, rather than by message's date.
+ Evolution requires a restart.
+ </long>
+ </locale>
+ </schema>
+
<!-- Message Window -->
<schema>
diff --git a/mail/message-list.c b/mail/message-list.c
index bb4de2da66..3b6d9ff2ce 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -111,6 +111,8 @@ struct _MessageListPrivate {
struct _MLSelection clipboard;
gboolean destroyed;
+
+ gboolean thread_latest;
};
static struct {
@@ -1441,21 +1443,26 @@ ml_tree_sort_value_at (ETreeModel *etm, ETreePath path, int col, void *model_dat
g_return_val_if_fail (msg_info != NULL, NULL);
if (col == COL_SENT) {
- ETreePath child;
+ if (message_list->priv->thread_latest) {
+ ETreePath child;
- child = e_tree_model_node_get_first_child(etm, path);
- if (child) {
- return GINT_TO_POINTER (subtree_latest (message_list, child, 1));
+ 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;
+ if (message_list->priv->thread_latest) {
+ ETreePath child;
- child = e_tree_model_node_get_first_child(etm, path);
- if (child) {
- return GINT_TO_POINTER (subtree_latest (message_list, child, 0));
+ 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));
}
@@ -2247,6 +2254,7 @@ message_list_construct (MessageList *message_list)
AtkObject *a11y;
gboolean construct_failed;
char *etspecfile;
+ GConfClient *gconf = mail_config_get_gconf_client ();
message_list->model =
e_tree_memory_callbacks_new (ml_tree_icon_at,
@@ -2273,9 +2281,11 @@ message_list_construct (MessageList *message_list)
message_list);
e_tree_memory_set_expanded_default(E_TREE_MEMORY(message_list->model),
- gconf_client_get_bool (mail_config_get_gconf_client(),
+ gconf_client_get_bool (gconf,
"/apps/evolution/mail/display/thread_expand",
NULL));
+
+ message_list->priv->thread_latest = gconf_client_get_bool (gconf, "/apps/evolution/mail/display/thread_latest", NULL);
/*
* The etree