aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-06-14 23:48:39 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-06-14 23:48:39 +0800
commit169c9aea03c1ba03d327af2a4f0fb8bb3aabd593 (patch)
treeb6aa8ea7bd74d4fd35529ad0a9624ad9ef67847f /mail
parentb355b7c2ed87e22b6f8a2471459277ab482c2d7a (diff)
downloadgsoc2013-evolution-169c9aea03c1ba03d327af2a4f0fb8bb3aabd593.tar.gz
gsoc2013-evolution-169c9aea03c1ba03d327af2a4f0fb8bb3aabd593.tar.zst
gsoc2013-evolution-169c9aea03c1ba03d327af2a4f0fb8bb3aabd593.zip
MessageList: Add a "thread-latest" property.
Bind this to the "thread-latest" GSettings key.
Diffstat (limited to 'mail')
-rw-r--r--mail/message-list.c54
-rw-r--r--mail/message-list.h3
2 files changed, 51 insertions, 6 deletions
diff --git a/mail/message-list.c b/mail/message-list.c
index bf04cd2c37..2619ebf6de 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -152,6 +152,7 @@ enum {
PROP_COPY_TARGET_LIST,
PROP_PASTE_TARGET_LIST,
PROP_SESSION,
+ PROP_THREAD_LATEST,
PROP_THREAD_SUBJECT
};
@@ -2645,6 +2646,12 @@ message_list_set_property (GObject *object,
g_value_get_object (value));
return;
+ case PROP_THREAD_LATEST:
+ message_list_set_thread_latest (
+ MESSAGE_LIST (object),
+ g_value_get_boolean (value));
+ return;
+
case PROP_THREAD_SUBJECT:
message_list_set_thread_subject (
MESSAGE_LIST (object),
@@ -2683,6 +2690,13 @@ message_list_get_property (GObject *object,
MESSAGE_LIST (object)));
return;
+ case PROP_THREAD_LATEST:
+ g_value_set_boolean (
+ value,
+ message_list_get_thread_latest (
+ MESSAGE_LIST (object)));
+ return;
+
case PROP_THREAD_SUBJECT:
g_value_set_boolean (
value,
@@ -2862,6 +2876,18 @@ message_list_class_init (MessageListClass *class)
g_object_class_install_property (
object_class,
+ PROP_THREAD_LATEST,
+ g_param_spec_boolean (
+ "thread-latest",
+ "Thread Latest",
+ "Sort threads by latest message",
+ TRUE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT |
+ G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (
+ object_class,
PROP_THREAD_SUBJECT,
g_param_spec_boolean (
"thread-subject",
@@ -2907,12 +2933,6 @@ message_list_construct (MessageList *message_list)
AtkObject *a11y;
gboolean constructed;
gchar *etspecfile;
- GSettings *settings;
-
- settings = g_settings_new ("org.gnome.evolution.mail");
- message_list->priv->thread_latest =
- g_settings_get_boolean (settings, "thread-latest");
- g_object_unref (settings);
/*
* The etree
@@ -3883,6 +3903,28 @@ message_list_get_paste_target_list (MessageList *message_list)
}
gboolean
+message_list_get_thread_latest (MessageList *message_list)
+{
+ g_return_val_if_fail (IS_MESSAGE_LIST (message_list), FALSE);
+
+ return message_list->priv->thread_latest;
+}
+
+void
+message_list_set_thread_latest (MessageList *message_list,
+ gboolean thread_latest)
+{
+ g_return_if_fail (IS_MESSAGE_LIST (message_list));
+
+ if (thread_latest == message_list->priv->thread_latest)
+ return;
+
+ message_list->priv->thread_latest = thread_latest;
+
+ g_object_notify (G_OBJECT (message_list), "thread-latest");
+}
+
+gboolean
message_list_get_thread_subject (MessageList *message_list)
{
g_return_val_if_fail (IS_MESSAGE_LIST (message_list), FALSE);
diff --git a/mail/message-list.h b/mail/message-list.h
index d4571e31d8..829e3c9c21 100644
--- a/mail/message-list.h
+++ b/mail/message-list.h
@@ -173,6 +173,9 @@ GtkTargetList * message_list_get_copy_target_list
(MessageList *message_list);
GtkTargetList * message_list_get_paste_target_list
(MessageList *message_list);
+gboolean message_list_get_thread_latest (MessageList *message_list);
+void message_list_set_thread_latest (MessageList *message_list,
+ gboolean thread_latest);
gboolean message_list_get_thread_subject (MessageList *message_list);
void message_list_set_thread_subject (MessageList *message_list,
gboolean thread_subject);