aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-reader.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/e-mail-reader.c')
-rw-r--r--mail/e-mail-reader.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 20448cc57f..4b02d69623 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -145,6 +145,8 @@ action_mail_add_sender_cb (GtkAction *action,
e_shell_event (shell, "contact-quick-add-email", (gpointer) address);
emu_remove_from_mail_cache_1 (address);
exit:
+ if (info)
+ camel_folder_free_message_info (folder, info);
em_utils_uids_free (uids);
}
@@ -179,7 +181,7 @@ action_add_to_address_book_cb (GtkAction *action,
cia = camel_internet_address_new ();
if (camel_address_decode (CAMEL_ADDRESS (cia), curl->path) < 0) {
- camel_object_unref (cia);
+ g_object_unref (cia);
goto exit;
}
@@ -191,7 +193,7 @@ action_add_to_address_book_cb (GtkAction *action,
e_shell_event (shell, "contact-quick-add-email", email);
emu_remove_from_mail_cache_1 (curl->path);
- camel_object_unref (cia);
+ g_object_unref (cia);
g_free (email);
exit:
@@ -864,7 +866,7 @@ action_mail_save_as_cb (GtkAction *action,
if (subject)
suggestion = g_strconcat (subject, ".mbox", NULL);
- camel_message_info_free (info);
+ camel_folder_free_message_info (folder, info);
}
if (!suggestion) {
@@ -1086,7 +1088,7 @@ action_search_folder_recipient_cb (GtkAction *action,
inet_addr = camel_internet_address_new ();
camel_address_decode (CAMEL_ADDRESS (inet_addr), curl->path);
vfolder_gui_add_from_address (inet_addr, AUTO_TO, folder_uri);
- camel_object_unref (inet_addr);
+ g_object_unref (inet_addr);
}
camel_url_free (curl);
@@ -1124,7 +1126,7 @@ action_search_folder_sender_cb (GtkAction *action,
inet_addr = camel_internet_address_new ();
camel_address_decode (CAMEL_ADDRESS (inet_addr), curl->path);
vfolder_gui_add_from_address (inet_addr, AUTO_FROM, folder_uri);
- camel_object_unref (inet_addr);
+ g_object_unref (inet_addr);
}
camel_url_free (curl);
@@ -1905,12 +1907,15 @@ mail_reader_message_selected_timeout_cb (EMailReader *reader)
GtkWidget *message_list;
EWebView *web_view;
CamelFolder *folder;
+ CamelStore *parent_store;
const gchar *cursor_uid;
const gchar *format_uid;
priv = E_MAIL_READER_GET_PRIVATE (reader);
folder = e_mail_reader_get_folder (reader);
+ parent_store = camel_folder_get_parent_store (folder);
+
html_display = e_mail_reader_get_html_display (reader);
message_list = e_mail_reader_get_message_list (reader);
@@ -1928,11 +1933,7 @@ mail_reader_message_selected_timeout_cb (EMailReader *reader)
widget = GTK_WIDGET (EM_FORMAT_HTML (html_display)->html);
-#if GTK_CHECK_VERSION(2,19,7)
html_display_visible = gtk_widget_get_mapped (widget);
-#else
- html_display_visible = GTK_WIDGET_MAPPED (widget);
-#endif
selected_uid_changed = g_strcmp0 (cursor_uid, format_uid);
if (html_display_visible && selected_uid_changed) {
@@ -1946,7 +1947,7 @@ mail_reader_message_selected_timeout_cb (EMailReader *reader)
e_web_view_load_string (web_view, string);
g_free (string);
- store_async = folder->parent_store->flags & CAMEL_STORE_ASYNC;
+ store_async = parent_store->flags & CAMEL_STORE_ASYNC;
if (store_async)
disp_func = mail_msg_unordered_push;
@@ -1980,11 +1981,13 @@ mail_reader_message_selected_cb (EMailReader *reader,
MessageList *message_list;
gboolean store_async;
CamelFolder *folder;
+ CamelStore *parent_store;
priv = E_MAIL_READER_GET_PRIVATE (reader);
folder = e_mail_reader_get_folder (reader);
- store_async = folder->parent_store->flags & CAMEL_STORE_ASYNC;
+ parent_store = camel_folder_get_parent_store (folder);
+ store_async = parent_store->flags & CAMEL_STORE_ASYNC;
/* Cancel previous message retrieval if the store is not async. */
if (!store_async && priv->retrieving_message_operation_id > 0)
@@ -2304,7 +2307,7 @@ mail_reader_update_actions (EMailReader *reader)
selection_has_not_junk_messages &&
!(state & E_MAIL_READER_FOLDER_IS_JUNK);
action = e_mail_reader_get_action (reader, action_name);
- gtk_action_set_sensitive (action, sensitive);
+ gtk_action_set_sensitive (action, sensitive && !(state & E_MAIL_READER_FOLDER_IS_JUNK));
action_name = "mail-mark-not-junk";
sensitive = selection_has_junk_messages;
@@ -2747,7 +2750,7 @@ e_mail_reader_check_state (EMailReader *reader)
uids = e_mail_reader_get_selected_uids (reader);
if (folder != NULL) {
- store = CAMEL_STORE (folder->parent_store);
+ store = camel_folder_get_parent_store (folder);
store_supports_vjunk = (store->flags & CAMEL_STORE_VJUNK);
is_junk_folder = (folder->folder_flags & CAMEL_FOLDER_IS_JUNK) != 0;
}
@@ -2831,6 +2834,8 @@ e_mail_reader_check_state (EMailReader *reader)
string = camel_message_info_mlist (info);
is_mailing_list &= (string != NULL && *string != '\0');
+
+ camel_folder_free_message_info (folder, info);
}
if (em_utils_check_user_can_send_mail ())