aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-05-19 08:08:25 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-05-19 08:08:25 +0800
commit79b0031a489e54319e7d3e19accaac40d6de7439 (patch)
tree1e907d6936a7f3ce5b4c557ca999f956537db1d8 /modules
parent3cda4f0d94c083199e89dae893ff5991ea3498c3 (diff)
downloadgsoc2013-evolution-79b0031a489e54319e7d3e19accaac40d6de7439.tar.gz
gsoc2013-evolution-79b0031a489e54319e7d3e19accaac40d6de7439.tar.zst
gsoc2013-evolution-79b0031a489e54319e7d3e19accaac40d6de7439.zip
Bug 619010 - Mailer's crash avoidance features are broken
Diffstat (limited to 'modules')
-rw-r--r--modules/mail/e-mail-shell-content.c53
-rw-r--r--modules/mail/e-mail-shell-settings.c4
2 files changed, 35 insertions, 22 deletions
diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c
index adda27da49..eb2cbf679e 100644
--- a/modules/mail/e-mail-shell-content.c
+++ b/modules/mail/e-mail-shell-content.c
@@ -69,10 +69,9 @@ struct _EMailShellContentPrivate {
/* Signal handler IDs */
guint message_list_built_id;
- guint group_by_threads : 1;
- guint preview_visible : 1;
- guint suppress_message_selection : 1;
- guint show_deleted : 1;
+ guint group_by_threads : 1;
+ guint preview_visible : 1;
+ guint show_deleted : 1;
};
enum {
@@ -120,8 +119,9 @@ mail_shell_content_message_list_built_cb (EMailShellContent *mail_shell_content,
MessageList *message_list)
{
EMailShellContentPrivate *priv = mail_shell_content->priv;
- EShellContent *shell_content;
EShellView *shell_view;
+ EShellWindow *shell_window;
+ EShellContent *shell_content;
GKeyFile *key_file;
gchar *uid;
@@ -131,6 +131,8 @@ mail_shell_content_message_list_built_cb (EMailShellContent *mail_shell_content,
shell_content = E_SHELL_CONTENT (mail_shell_content);
shell_view = e_shell_content_get_shell_view (shell_content);
+ shell_window = e_shell_view_get_shell_window (shell_view);
+
key_file = e_shell_view_get_state_key_file (shell_view);
if (message_list->cursor_uid != NULL)
@@ -139,10 +141,11 @@ mail_shell_content_message_list_built_cb (EMailShellContent *mail_shell_content,
else if (message_list->folder_uri == NULL)
uid = NULL;
- else if (mail_shell_content->priv->suppress_message_selection)
+ else if (e_shell_window_get_safe_mode (shell_window)) {
+ e_shell_window_set_safe_mode (shell_window, FALSE);
uid = NULL;
- else {
+ } else {
const gchar *folder_uri;
const gchar *key;
gchar *group_name;
@@ -561,29 +564,33 @@ mail_shell_content_set_folder (EMailReader *reader,
CamelFolder *folder,
const gchar *folder_uri)
{
+ EShell *shell;
EShellView *shell_view;
+ EShellWindow *shell_window;
EShellContent *shell_content;
+ EShellSettings *shell_settings;
EMailShellContentPrivate *priv;
EMailReaderIface *default_iface;
GtkWidget *message_list;
- CamelFolder *old_folder;
GKeyFile *key_file;
gchar *group_name;
const gchar *key;
- gboolean different_folder;
gboolean value;
GError *error = NULL;
priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (reader);
- old_folder = e_mail_reader_get_folder (reader);
+ shell_content = E_SHELL_CONTENT (reader);
+ shell_view = e_shell_content_get_shell_view (shell_content);
+ shell_window = e_shell_view_get_shell_window (shell_view);
+
+ shell = e_shell_window_get_shell (shell_window);
+ shell_settings = e_shell_get_shell_settings (shell);
+
message_list = e_mail_reader_get_message_list (reader);
message_list_freeze (MESSAGE_LIST (message_list));
- different_folder =
- (old_folder != NULL && folder != old_folder);
-
/* Chain up to interface's default set_folder() method. */
default_iface = g_type_default_interface_peek (E_TYPE_MAIL_READER);
default_iface->set_folder (reader, folder, folder_uri);
@@ -593,12 +600,6 @@ mail_shell_content_set_folder (EMailReader *reader,
mail_refresh_folder (folder, NULL, NULL);
- /* This function gets triggered several times at startup,
- * so we don't want to reset the message suppression state
- * unless we're actually switching to a different folder. */
- if (different_folder)
- priv->suppress_message_selection = FALSE;
-
/* This is a one-time-only callback. */
if (MESSAGE_LIST (message_list)->cursor_uid == NULL &&
priv->message_list_built_id == 0)
@@ -609,9 +610,6 @@ mail_shell_content_set_folder (EMailReader *reader,
/* Restore the folder's preview and threaded state. */
- shell_content = E_SHELL_CONTENT (reader);
- shell_view = e_shell_content_get_shell_view (shell_content);
-
key_file = e_shell_view_get_state_key_file (shell_view);
group_name = g_strdup_printf ("Folder %s", folder_uri);
@@ -632,6 +630,17 @@ mail_shell_content_set_folder (EMailReader *reader,
g_clear_error (&error);
}
+ /* XXX This is a little confusing and needs rethought. The
+ * EShellWindow:safe-mode property blocks automatic message
+ * selection, but the "mail-safe-list" shell setting blocks
+ * both the preview pane and automatic message selection. */
+ if (e_shell_settings_get_boolean (shell_settings, "mail-safe-list")) {
+ e_shell_settings_set_boolean (
+ shell_settings, "mail-safe-list", FALSE);
+ e_shell_window_set_safe_mode (shell_window, TRUE);
+ value = FALSE;
+ }
+
e_mail_shell_content_set_preview_visible (
E_MAIL_SHELL_CONTENT (shell_content), value);
diff --git a/modules/mail/e-mail-shell-settings.c b/modules/mail/e-mail-shell-settings.c
index d6e8fd698b..7303aeea5b 100644
--- a/modules/mail/e-mail-shell-settings.c
+++ b/modules/mail/e-mail-shell-settings.c
@@ -166,6 +166,10 @@ e_mail_shell_settings_init (EShell *shell)
"/apps/evolution/mail/format/reply_style");
e_shell_settings_install_property_for_key (
+ "mail-safe-list",
+ "/apps/evolution/mail/display/safe_list");
+
+ e_shell_settings_install_property_for_key (
"mail-show-animated-images",
"/apps/evolution/mail/display/animated_images");