aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-06-02 00:24:39 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-06-02 00:41:56 +0800
commit4905b26133f891add3d953146d69daeccf616f04 (patch)
treef92a14bb163204f98bd68ce0e3516535592d8ccd
parent3c14ae32fe27e548d86926ab23633f1749cb25a3 (diff)
downloadgsoc2013-evolution-4905b26133f891add3d953146d69daeccf616f04.tar
gsoc2013-evolution-4905b26133f891add3d953146d69daeccf616f04.tar.gz
gsoc2013-evolution-4905b26133f891add3d953146d69daeccf616f04.tar.bz2
gsoc2013-evolution-4905b26133f891add3d953146d69daeccf616f04.tar.lz
gsoc2013-evolution-4905b26133f891add3d953146d69daeccf616f04.tar.xz
gsoc2013-evolution-4905b26133f891add3d953146d69daeccf616f04.tar.zst
gsoc2013-evolution-4905b26133f891add3d953146d69daeccf616f04.zip
EMailReader cleanups.
(cherry picked from commit 9528240fe85b084143db3f6be003b97555e480cb)
-rw-r--r--mail/e-mail-reader.c288
-rw-r--r--mail/e-mail-reader.h3
2 files changed, 168 insertions, 123 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index db43f23596..9fef119e82 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -204,7 +204,7 @@ action_mail_add_sender_cb (GtkAction *action,
g_object_unref (cia);
exit:
- if (info)
+ if (info != NULL)
camel_folder_free_message_info (folder, info);
em_utils_uids_free (uids);
}
@@ -215,6 +215,7 @@ action_add_to_address_book_cb (GtkAction *action,
{
EShell *shell;
EMailBackend *backend;
+ EMailDisplay *display;
EMailSession *session;
EShellBackend *shell_backend;
CamelInternetAddress *cia;
@@ -230,10 +231,11 @@ action_add_to_address_book_cb (GtkAction *action,
backend = e_mail_reader_get_backend (reader);
session = e_mail_backend_get_session (backend);
- web_view = E_WEB_VIEW (e_mail_reader_get_mail_display (reader));
- if (!web_view)
+ display = e_mail_reader_get_mail_display (reader);
+ if (display == NULL)
return;
+ web_view = E_WEB_VIEW (display);
uri = e_web_view_get_selected_uri (web_view);
g_return_if_fail (uri != NULL);
@@ -293,6 +295,8 @@ static void
action_mail_image_save_cb (GtkAction *action,
EMailReader *reader)
{
+ EShell *shell;
+ EMailBackend *backend;
EMailDisplay *display;
EWebView *web_view;
EMailPartList *parts;
@@ -302,14 +306,16 @@ action_mail_image_save_cb (GtkAction *action,
EAttachment *attachment;
GFile *file;
- display = e_mail_reader_get_mail_display (reader);
- web_view = E_WEB_VIEW (display);
+ backend = e_mail_reader_get_backend (reader);
+ shell = e_shell_backend_get_shell (E_SHELL_BACKEND (backend));
- if (!E_IS_WEB_VIEW (web_view))
+ display = e_mail_reader_get_mail_display (reader);
+ if (display == NULL)
return;
+ web_view = E_WEB_VIEW (display);
image_src = e_web_view_get_cursor_image_src (web_view);
- if (!image_src)
+ if (image_src == NULL)
return;
parts = e_mail_display_get_parts_list (display);
@@ -331,23 +337,26 @@ action_mail_image_save_cb (GtkAction *action,
const gchar *filename;
const gchar *user_cache_dir;
- /* Open cache and find the file there */
+ /* Open cache and find the file there */
user_cache_dir = e_get_user_cache_dir ();
cache = camel_data_cache_new (user_cache_dir, NULL);
- image_stream = camel_data_cache_get (cache, "http", image_src, NULL);
- if (!image_stream) {
+ image_stream = camel_data_cache_get (
+ cache, "http", image_src, NULL);
+ if (image_stream == NULL) {
g_object_unref (cache);
return;
}
filename = strrchr (image_src, '/');
- if (filename && strchr (filename, '?'))
- filename = NULL;
- else if (filename)
- filename = filename + 1;
+ if (filename != NULL) {
+ if (strchr (filename, '?') == NULL)
+ filename++;
+ else
+ filename = NULL;
+ }
part = camel_mime_part_new ();
- if (filename)
+ if (filename != NULL)
camel_mime_part_set_filename (part, filename);
dw = camel_data_wrapper_new ();
@@ -366,8 +375,8 @@ action_mail_image_save_cb (GtkAction *action,
}
file = e_shell_run_save_dialog (
- e_shell_get_default (),
- _("Save Image"), camel_mime_part_get_filename (part),
+ shell, _("Save Image"),
+ camel_mime_part_get_filename (part),
NULL, NULL, NULL);
if (file == NULL) {
g_object_unref (part);
@@ -629,7 +638,7 @@ get_close_browser_reader (EMailReader *reader)
GSettings *settings;
const gchar *key;
gchar *value;
- gboolean close_it = FALSE;
+ gboolean close_it;
/* only allow closing of a mail browser and nothing else */
if (!E_IS_MAIL_BROWSER (reader))
@@ -640,9 +649,11 @@ get_close_browser_reader (EMailReader *reader)
key = "prompt-on-reply-close-browser";
value = g_settings_get_string (settings, key);
- if (value && g_str_equal (value, "always")) {
+ if (g_strcmp0 (value, "always") == 0) {
close_it = TRUE;
- } else if (!value || !g_str_equal (value, "never")) {
+ } else if (g_strcmp0 (value, "never") == 0) {
+ close_it = FALSE;
+ } else {
GtkWidget *dialog;
GtkWindow *parent;
gint response;
@@ -656,7 +667,7 @@ get_close_browser_reader (EMailReader *reader)
shell = e_shell_backend_get_shell (shell_backend);
parent = e_shell_get_active_window (shell);
- if (!parent)
+ if (parent == NULL)
parent = e_mail_reader_get_window (reader);
dialog = e_alert_dialog_new_for_args (
@@ -664,7 +675,9 @@ get_close_browser_reader (EMailReader *reader)
response = gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
- close_it = response == GTK_RESPONSE_YES || response == GTK_RESPONSE_OK;
+ close_it =
+ (response == GTK_RESPONSE_YES) ||
+ (response == GTK_RESPONSE_OK);
if (response == GTK_RESPONSE_OK)
g_settings_set_string (settings, key, "always");
@@ -825,16 +838,24 @@ is_junk_folder_selected (EMailReader *reader)
folder = e_mail_reader_get_folder (reader);
- return folder && (folder->folder_flags & CAMEL_FOLDER_IS_JUNK) != 0;
+ if (folder == NULL)
+ return FALSE;
+
+ return (folder->folder_flags & CAMEL_FOLDER_IS_JUNK) != 0;
}
static void
action_mail_mark_junk_cb (GtkAction *action,
EMailReader *reader)
{
- guint32 mask = CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_JUNK |
- CAMEL_MESSAGE_NOTJUNK | CAMEL_MESSAGE_JUNK_LEARN;
- guint32 set = CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_JUNK |
+ guint32 mask =
+ CAMEL_MESSAGE_SEEN |
+ CAMEL_MESSAGE_JUNK |
+ CAMEL_MESSAGE_NOTJUNK |
+ CAMEL_MESSAGE_JUNK_LEARN;
+ guint32 set =
+ CAMEL_MESSAGE_SEEN |
+ CAMEL_MESSAGE_JUNK |
CAMEL_MESSAGE_JUNK_LEARN;
if (e_mail_reader_mark_selected (reader, mask, set) == 1 &&
@@ -846,9 +867,13 @@ static void
action_mail_mark_notjunk_cb (GtkAction *action,
EMailReader *reader)
{
- guint32 mask = CAMEL_MESSAGE_JUNK | CAMEL_MESSAGE_NOTJUNK |
+ guint32 mask =
+ CAMEL_MESSAGE_JUNK |
+ CAMEL_MESSAGE_NOTJUNK |
+ CAMEL_MESSAGE_JUNK_LEARN;
+ guint32 set =
+ CAMEL_MESSAGE_NOTJUNK |
CAMEL_MESSAGE_JUNK_LEARN;
- guint32 set = CAMEL_MESSAGE_NOTJUNK | CAMEL_MESSAGE_JUNK_LEARN;
if (e_mail_reader_mark_selected (reader, mask, set) == 1 &&
is_junk_folder_selected (reader))
@@ -1151,7 +1176,7 @@ action_mail_previous_important_cb (GtkAction *action,
static void
action_mail_previous_thread_cb (GtkAction *action,
- EMailReader *reader)
+ EMailReader *reader)
{
GtkWidget *message_list;
@@ -1340,9 +1365,13 @@ action_mail_reply_all_check (CamelFolder *folder,
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check))) {
GSettings *settings;
+ const gchar *key;
settings = g_settings_new ("org.gnome.evolution.mail");
- g_settings_set_boolean (settings, "prompt-on-reply-many-recips", FALSE);
+
+ key = "prompt-on-reply-many-recips";
+ g_settings_set_boolean (settings, key, FALSE);
+
g_object_unref (settings);
}
@@ -1381,8 +1410,10 @@ action_mail_reply_all_cb (GtkAction *action,
state = e_mail_reader_check_state (reader);
settings = g_settings_new ("org.gnome.evolution.mail");
+
key = "prompt-on-reply-many-recips";
ask = g_settings_get_boolean (settings, key);
+
g_object_unref (settings);
if (ask && !(state & E_MAIL_READER_SELECTION_IS_MAILING_LIST)) {
@@ -1426,11 +1457,15 @@ action_mail_reply_group_cb (GtkAction *action,
GSettings *settings;
gboolean reply_list;
guint32 state;
+ const gchar *key;
state = e_mail_reader_check_state (reader);
settings = g_settings_new ("org.gnome.evolution.mail");
- reply_list = g_settings_get_boolean (settings, "composer-group-reply-to-list");
+
+ key = "composer-group-reply-to-list";
+ reply_list = g_settings_get_boolean (settings, key);
+
g_object_unref (settings);
if (reply_list && (state & E_MAIL_READER_SELECTION_IS_MAILING_LIST)) {
@@ -1454,8 +1489,9 @@ message_is_list_administrative (CamelMimeMessage *message)
{
const gchar *header;
- header = camel_medium_get_header ((CamelMedium *) message, "X-List-Administrivia");
- if (!header)
+ header = camel_medium_get_header (
+ CAMEL_MEDIUM (message), "X-List-Administrivia");
+ if (header == NULL)
return FALSE;
while (*header == ' ' || *header == '\t')
@@ -1477,6 +1513,7 @@ action_mail_reply_sender_check (CamelFolder *folder,
gboolean ask_list_reply_to;
gboolean munged_list_message;
gboolean active;
+ const gchar *key;
GError *error = NULL;
alert_sink = e_activity_get_alert_sink (closure->activity);
@@ -1503,20 +1540,21 @@ action_mail_reply_sender_check (CamelFolder *folder,
settings = g_settings_new ("org.gnome.evolution.mail");
- ask_ignore_list_reply_to = g_settings_get_boolean (
- settings, "composer-ignore-list-reply-to");
- ask_list_reply_to = g_settings_get_boolean (
- settings, "prompt-on-list-reply-to");
+ key = "composer-ignore-list-reply-to";
+ ask_ignore_list_reply_to = g_settings_get_boolean (settings, key);
+
+ key = "prompt-on-list-reply-to";
+ ask_list_reply_to = g_settings_get_boolean (settings, key);
munged_list_message = em_utils_is_munged_list_message (message);
if (message_is_list_administrative (message)) {
- /* Do not ask for messages which are list administrative, like
- * list confirmation messages */
+ /* Do not ask for messages which are list administrative,
+ * like list confirmation messages. */
} else if (ask_ignore_list_reply_to || !munged_list_message) {
- /* Don't do the "Are you sure you want to reply in private?" pop-up
- * if it's a Reply-To: munged list message... unless we're ignoring
- * munging. */
+ /* Don't do the "Are you sure you want to reply in private?"
+ * pop-up if it's a Reply-To: munged list message... unless
+ * we're ignoring munging. */
GtkWidget *dialog;
GtkWidget *check;
GtkWidget *container;
@@ -1541,8 +1579,8 @@ action_mail_reply_sender_check (CamelFolder *folder,
active = gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON (check));
if (active) {
- g_settings_set_boolean (
- settings, "prompt-on-private-list-reply", FALSE);
+ key = "prompt-on-private-list-reply";
+ g_settings_set_boolean (settings, key, FALSE);
}
gtk_widget_destroy (dialog);
@@ -1588,14 +1626,14 @@ action_mail_reply_sender_check (CamelFolder *folder,
active = gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON (check_again));
if (active) {
- g_settings_set_boolean (
- settings, "prompt-on-list-reply-to", FALSE);
+ key = "prompt-on-list-reply-to";
+ g_settings_set_boolean (settings, key, FALSE);
}
+ key = "composer-ignore-list-reply-to";
active = gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON (check_always_ignore));
- g_settings_set_boolean (
- settings, "composer-ignore-list-reply-to", active);
+ g_settings_set_boolean (settings, key, active);
gtk_widget_destroy (dialog);
@@ -1633,14 +1671,18 @@ action_mail_reply_sender_cb (GtkAction *action,
gboolean ask_private_list_reply;
gboolean ask;
guint32 state;
+ const gchar *key;
state = e_mail_reader_check_state (reader);
settings = g_settings_new ("org.gnome.evolution.mail");
- ask_list_reply_to = g_settings_get_boolean (
- settings, "prompt-on-list-reply-to");
- ask_private_list_reply = g_settings_get_boolean (
- settings, "prompt-on-private-list-reply");
+
+ key = "prompt-on-list-reply-to";
+ ask_list_reply_to = g_settings_get_boolean (settings, key);
+
+ key = "prompt-on-private-list-reply";
+ ask_private_list_reply = g_settings_get_boolean (settings, key);
+
g_object_unref (settings);
ask = (ask_private_list_reply || ask_list_reply_to);
@@ -1727,69 +1769,67 @@ action_mail_show_all_headers_cb (GtkToggleAction *action,
EMailReader *reader)
{
EMailDisplay *display;
+ EMailFormatterMode mode;
display = e_mail_reader_get_mail_display (reader);
- /* mode change when viewing message source is ignored */
- if (e_mail_display_get_mode (display) == E_MAIL_FORMATTER_MODE_SOURCE ||
- e_mail_display_get_mode (display) == E_MAIL_FORMATTER_MODE_RAW)
+ /* Ignore action when viewing message source. */
+ mode = e_mail_display_get_mode (display);
+ if (mode == E_MAIL_FORMATTER_MODE_SOURCE)
+ return;
+ if (mode == E_MAIL_FORMATTER_MODE_RAW)
return;
if (gtk_toggle_action_get_active (action))
- e_mail_display_set_mode (display, E_MAIL_FORMATTER_MODE_ALL_HEADERS);
+ mode = E_MAIL_FORMATTER_MODE_ALL_HEADERS;
else
- e_mail_display_set_mode (display, E_MAIL_FORMATTER_MODE_NORMAL);
-}
+ mode = E_MAIL_FORMATTER_MODE_NORMAL;
-struct _source_retrieval_closure {
- EMailReader *browser;
- EActivity *activity;
- gchar *message_uid;
-};
+ e_mail_display_set_mode (display, mode);
+}
static void
-mail_source_retrieved (GObject *object,
+mail_source_retrieved (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
+ EMailReaderClosure *closure;
CamelMimeMessage *message;
EMailDisplay *display;
GError *error = NULL;
- struct _source_retrieval_closure *data;
- data = user_data;
- display = e_mail_reader_get_mail_display (data->browser);
+ closure = (EMailReaderClosure *) user_data;
+ display = e_mail_reader_get_mail_display (closure->reader);
message = camel_folder_get_message_finish (
- CAMEL_FOLDER (object), result, &error);
+ CAMEL_FOLDER (source_object), result, &error);
/* Sanity check. */
g_return_if_fail (
((message != NULL) && (error == NULL)) ||
((message == NULL) && (error != NULL)));
- if (error != NULL) {
+ if (message != NULL) {
+ mail_reader_set_display_formatter_for_message (
+ closure->reader, display,
+ closure->message_uid, message,
+ CAMEL_FOLDER (source_object));
+ } else {
gchar *status;
+
status = g_strdup_printf (
"%s<br>%s",
_("Failed to retrieve message:"),
error->message);
e_mail_display_set_status (display, status);
- g_error_free (error);
g_free (status);
- goto free_data;
+
+ g_error_free (error);
}
- mail_reader_set_display_formatter_for_message (
- data->browser, display, data->message_uid,
- message, CAMEL_FOLDER (object));
+ e_activity_set_state (closure->activity, E_ACTIVITY_COMPLETED);
- free_data:
- e_activity_set_state (data->activity, E_ACTIVITY_COMPLETED);
- g_object_unref (data->browser);
- g_object_unref (data->activity);
- g_free (data->message_uid);
- g_free (data);
+ mail_reader_closure_free (closure);
}
static void
@@ -1805,7 +1845,7 @@ action_mail_show_source_cb (GtkAction *action,
gchar *string;
EActivity *activity;
GCancellable *cancellable;
- struct _source_retrieval_closure *closure;
+ EMailReaderClosure *closure;
backend = e_mail_reader_get_backend (reader);
folder = e_mail_reader_get_folder (reader);
@@ -1813,7 +1853,8 @@ action_mail_show_source_cb (GtkAction *action,
g_return_if_fail (uids != NULL && uids->len == 1);
message_uid = g_ptr_array_index (uids, 0);
- browser = e_mail_browser_new (backend, NULL, NULL, E_MAIL_FORMATTER_MODE_SOURCE);
+ browser = e_mail_browser_new (
+ backend, NULL, NULL, E_MAIL_FORMATTER_MODE_SOURCE);
e_mail_reader_set_folder (E_MAIL_READER (browser), folder);
e_mail_reader_set_message (E_MAIL_READER (browser), message_uid);
display = e_mail_reader_get_mail_display (E_MAIL_READER (browser));
@@ -1828,14 +1869,16 @@ action_mail_show_source_cb (GtkAction *action,
cancellable = e_activity_get_cancellable (activity);
g_free (string);
- closure = g_new0 (struct _source_retrieval_closure, 1);
- closure->browser = g_object_ref (E_MAIL_READER (browser));
- closure->activity = activity;
+ closure = g_slice_new0 (EMailReaderClosure);
+ closure->reader = g_object_ref (browser);
+ closure->activity = g_object_ref (activity);
closure->message_uid = g_strdup (message_uid);
+
camel_folder_get_message (
folder, message_uid, G_PRIORITY_DEFAULT,
- cancellable, mail_source_retrieved,
- closure);
+ cancellable, mail_source_retrieved, closure);
+
+ g_object_unref (activity);
em_utils_uids_free (uids);
}
@@ -2622,16 +2665,19 @@ mail_reader_key_press_event_cb (EMailReader *reader,
display = e_mail_reader_get_mail_display (reader);
frame = webkit_web_view_get_focused_frame (WEBKIT_WEB_VIEW (display));
- if (frame) {
+ if (frame != NULL) {
dom = webkit_web_frame_get_dom_document (frame);
/* intentionally used "static_cast" */
element = webkit_dom_html_document_get_active_element ((WebKitDOMHTMLDocument *) dom);
- if (element)
+ if (element != NULL)
name = webkit_dom_node_get_node_name (WEBKIT_DOM_NODE (element));
- /* if INPUT or TEXTAREA has focus, then any key press should go there */
- if (name && (g_ascii_strcasecmp (name, "INPUT") == 0 || g_ascii_strcasecmp (name, "TEXTAREA") == 0)) {
+ /* If INPUT or TEXTAREA has focus,
+ * then any key press should go there. */
+ if (name != NULL &&
+ (g_ascii_strcasecmp (name, "INPUT") == 0 ||
+ g_ascii_strcasecmp (name, "TEXTAREA") == 0)) {
g_free (name);
return FALSE;
}
@@ -2743,7 +2789,7 @@ mail_reader_message_seen_cb (EMailReaderClosure *closure)
current_uid = MESSAGE_LIST (message_list)->cursor_uid;
uid_is_current &= (g_strcmp0 (current_uid, message_uid) == 0);
- if (parts)
+ if (parts != NULL)
message = e_mail_part_list_get_message (parts);
else
message = NULL;
@@ -2845,7 +2891,8 @@ mail_reader_message_loaded_cb (CamelFolder *folder,
/* If the private struct is NULL, the EMailReader was destroyed
* while we were loading the message and we're likely holding the
- * last reference. Nothing to do but drop the reference. */
+ * last reference. Nothing to do but drop the reference.
+ * FIXME Use a GWeakRef instead of this hack. */
if (priv == NULL) {
mail_reader_closure_free (closure);
return;
@@ -2862,9 +2909,9 @@ mail_reader_message_loaded_cb (CamelFolder *folder,
message_list = e_mail_reader_get_message_list (reader);
- if (!message_list) {
- /* for cases where message fetching took so long that
- * user closed the message window before this was called */
+ if (message_list == NULL) {
+ /* For cases where message fetching took so long that
+ * user closed the message window before this was called. */
goto exit;
}
@@ -2875,7 +2922,8 @@ mail_reader_message_loaded_cb (CamelFolder *folder,
exit:
priv->restoring_message_selection = FALSE;
- if (error) {
+
+ if (error != NULL) {
EPreviewPane *preview_pane;
EWebView *web_view;
@@ -2892,8 +2940,7 @@ exit:
mail_reader_closure_free (closure);
- if (message)
- g_object_unref (message);
+ g_clear_object (&message);
}
static gboolean
@@ -2938,7 +2985,8 @@ mail_reader_message_selected_timeout_cb (EMailReader *reader)
EActivity *activity;
gchar *string;
- string = g_strdup_printf (_("Retrieving message '%s'"), cursor_uid);
+ string = g_strdup_printf (
+ _("Retrieving message '%s'"), cursor_uid);
e_mail_display_set_parts_list (display, NULL);
e_mail_display_set_status (display, string);
g_free (string);
@@ -2985,7 +3033,7 @@ mail_reader_message_selected_cb (EMailReader *reader,
/* Cancel the seen timer. */
message_list = MESSAGE_LIST (e_mail_reader_get_message_list (reader));
- if (message_list && message_list->seen_id) {
+ if (message_list != NULL && message_list->seen_id) {
g_source_remove (message_list->seen_id);
message_list->seen_id = 0;
}
@@ -3003,8 +3051,9 @@ mail_reader_message_selected_cb (EMailReader *reader,
priv->folder_was_just_selected = FALSE;
if (message_list_selected_count (message_list) != 1) {
- EMailDisplay *display = e_mail_reader_get_mail_display (reader);
+ EMailDisplay *display;
+ display = e_mail_reader_get_mail_display (reader);
e_mail_display_set_parts_list (display, NULL);
e_web_view_clear (E_WEB_VIEW (display));
} else if (priv->restoring_message_selection) {
@@ -3141,9 +3190,9 @@ mail_reader_set_folder (EMailReader *reader,
priv->folder_was_just_selected = (folder != NULL);
- /* this is to make sure any post-poned changes in Search Folders
- * will be propagated on folder selection */
- if (folder && CAMEL_IS_VEE_FOLDER (folder))
+ /* This is to make sure any post-poned changes in Search
+ * Folders will be propagated on folder selection. */
+ if (CAMEL_IS_VEE_FOLDER (folder))
mail_sync_folder (folder, FALSE, NULL, NULL);
message_list_set_folder (
@@ -3173,12 +3222,6 @@ mail_reader_folder_loaded (EMailReader *reader)
e_mail_reader_update_actions (reader, state);
}
-struct format_parser_async_closure_ {
- struct _formatter_weak_ref_closure *weak_ref_closure;
- EMailDisplay *display;
- EActivity *activity;
-};
-
static void
set_mail_display_part_list (GObject *object,
GAsyncResult *result,
@@ -3196,8 +3239,8 @@ set_mail_display_part_list (GObject *object,
e_mail_display_set_parts_list (display, part_list);
e_mail_display_load (display, NULL);
- /* Remove the reference added when parts list was created,
- * so that only owners are EMailDisplays */
+ /* Remove the reference added when parts list was
+ * created, so that only owners are EMailDisplays. */
g_object_unref (part_list);
}
@@ -3220,12 +3263,10 @@ mail_reader_set_display_formatter_for_message (EMailReader *reader,
g_free (mail_uri);
if (parts == NULL) {
-
e_mail_reader_parse_message (
reader, folder, message_uid, message,
priv->retrieving_message,
set_mail_display_part_list, NULL);
-
} else {
e_mail_display_set_parts_list (display, parts);
e_mail_display_load (display, NULL);
@@ -3939,10 +3980,10 @@ e_mail_reader_init (EMailReader *reader,
/* Likewise the "mail-reply-group" action. */
- /* For Translators: "Group Reply" will reply either to a mailing list
- (if possible and if that configuration option is enabled), or else
- it will reply to all. The word "Group" was chosen because it covers
- either of those, without too strongly implying one or the other. */
+ /* For Translators: "Group Reply" will reply either to a mailing list
+ * (if possible and if that configuration option is enabled), or else
+ * it will reply to all. The word "Group" was chosen because it covers
+ * either of those, without too strongly implying one or the other. */
menu_tool_action = e_menu_tool_action_new (
"mail-reply-group", _("Group Reply"),
_("Reply to the mailing list, or to all recipients"), NULL);
@@ -3998,7 +4039,7 @@ e_mail_reader_init (EMailReader *reader,
settings, "show-all-headers",
action, "active", G_SETTINGS_BIND_DEFAULT);
- /* mode change when viewing message source is ignored */
+ /* Mode change when viewing message source is ignored. */
if (e_mail_display_get_mode (display) == E_MAIL_FORMATTER_MODE_SOURCE ||
e_mail_display_get_mode (display) == E_MAIL_FORMATTER_MODE_RAW) {
gtk_action_set_sensitive (action, FALSE);
@@ -4230,7 +4271,8 @@ e_mail_reader_check_state (EMailReader *reader)
shell = e_shell_backend_get_shell (E_SHELL_BACKEND (backend));
registry = e_shell_get_registry (shell);
mail_session = e_mail_backend_get_session (backend);
- account_store = e_mail_ui_session_get_account_store (E_MAIL_UI_SESSION (mail_session));
+ account_store = e_mail_ui_session_get_account_store (
+ E_MAIL_UI_SESSION (mail_session));
folder = e_mail_reader_get_folder (reader);
uids = e_mail_reader_get_selected_uids (reader);
@@ -4327,7 +4369,9 @@ e_mail_reader_check_state (EMailReader *reader)
camel_folder_free_message_info (folder, info);
}
- have_enabled_account = e_mail_account_store_have_enabled_service (account_store, CAMEL_TYPE_STORE);
+ have_enabled_account =
+ e_mail_account_store_have_enabled_service (
+ account_store, CAMEL_TYPE_STORE);
if (have_enabled_account)
state |= E_MAIL_READER_HAVE_ENABLED_ACCOUNT;
diff --git a/mail/e-mail-reader.h b/mail/e-mail-reader.h
index 1d513f0a8a..8c05ed0149 100644
--- a/mail/e-mail-reader.h
+++ b/mail/e-mail-reader.h
@@ -179,7 +179,8 @@ void e_mail_reader_enable_show_folder
void e_mail_reader_avoid_next_mark_as_seen
(EMailReader *reader);
-EMailFormatter * e_mail_reader_get_formatter (EMailReader *reader);
+EMailFormatter *
+ e_mail_reader_get_formatter (EMailReader *reader);
void e_mail_reader_set_formatter (EMailReader *reader,
EMailFormatter *formatter);