diff options
author | Milan Crha <mcrha@redhat.com> | 2012-05-03 19:45:37 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2012-05-03 19:45:37 +0800 |
commit | 6c1a8089235c9dad49c3ce37d188ca9de0d06bbf (patch) | |
tree | 5ecd6743bf17a297d0b1ad828f19db85680163ef /mail/e-mail-paned-view.c | |
parent | a5984501854e6625a92f6323cfef5aaea1225484 (diff) | |
download | gsoc2013-evolution-6c1a8089235c9dad49c3ce37d188ca9de0d06bbf.tar.gz gsoc2013-evolution-6c1a8089235c9dad49c3ce37d188ca9de0d06bbf.tar.zst gsoc2013-evolution-6c1a8089235c9dad49c3ce37d188ca9de0d06bbf.zip |
Bug #669445 - A way of turning Message Preview off by default
Diffstat (limited to 'mail/e-mail-paned-view.c')
-rw-r--r-- | mail/e-mail-paned-view.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c index 5c7b356fca..bd76dd967c 100644 --- a/mail/e-mail-paned-view.c +++ b/mail/e-mail-paned-view.c @@ -84,6 +84,7 @@ enum { #define STATE_KEY_GROUP_BY_THREADS "GroupByThreads" #define STATE_KEY_SELECTED_MESSAGE "SelectedMessage" #define STATE_KEY_PREVIEW_VISIBLE "PreviewVisible" +#define STATE_GROUP_GLOBAL_FOLDER "GlobalFolder" /* Forward Declarations */ static void e_mail_paned_view_reader_init (EMailReaderInterface *interface); @@ -122,6 +123,8 @@ mail_paned_view_save_boolean (EMailView *view, g_free (group_name); g_free (folder_uri); + g_key_file_set_boolean (key_file, STATE_GROUP_GLOBAL_FOLDER, key, value); + e_shell_view_set_state_dirty (shell_view); } @@ -508,7 +511,7 @@ mail_paned_view_set_folder (EMailReader *reader, gchar *folder_uri; gchar *group_name; const gchar *key; - gboolean value; + gboolean value, global_view_settings; GError *error = NULL; priv = E_MAIL_PANED_VIEW_GET_PRIVATE (reader); @@ -519,6 +522,7 @@ mail_paned_view_set_folder (EMailReader *reader, shell = e_shell_window_get_shell (shell_window); shell_settings = e_shell_get_shell_settings (shell); + global_view_settings = e_shell_settings_get_boolean (shell_settings, "mail-global-view-setting"); message_list = e_mail_reader_get_message_list (reader); @@ -551,19 +555,31 @@ mail_paned_view_set_folder (EMailReader *reader, g_free (folder_uri); key = STATE_KEY_GROUP_BY_THREADS; - value = g_key_file_get_boolean (key_file, group_name, key, &error); + value = g_key_file_get_boolean (key_file, global_view_settings ? STATE_GROUP_GLOBAL_FOLDER : group_name, key, &error); if (error != NULL) { - value = TRUE; g_clear_error (&error); + + value = !global_view_settings || + g_key_file_get_boolean (key_file, STATE_GROUP_GLOBAL_FOLDER, key, &error); + if (error != NULL) { + g_clear_error (&error); + value = TRUE; + } } e_mail_reader_set_group_by_threads (reader, value); key = STATE_KEY_PREVIEW_VISIBLE; - value = g_key_file_get_boolean (key_file, group_name, key, &error); + value = g_key_file_get_boolean (key_file, global_view_settings ? STATE_GROUP_GLOBAL_FOLDER : group_name, key, &error); if (error != NULL) { - value = TRUE; g_clear_error (&error); + + value = !global_view_settings || + g_key_file_get_boolean (key_file, STATE_GROUP_GLOBAL_FOLDER, key, &error); + if (error != NULL) { + g_clear_error (&error); + value = TRUE; + } } /* XXX This is a little confusing and needs rethought. The |