diff options
author | Milan Crha <mcrha@redhat.com> | 2010-04-29 22:31:31 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2010-04-29 22:31:31 +0800 |
commit | ad1b3754f7152ecdf76a9f9ddde2a394c0588800 (patch) | |
tree | 77bb7d474e1829e34cd68ebdc0fae990134f167f | |
parent | cbd3b67ea03a1c4c4333f88a2bb569df62678645 (diff) | |
download | gsoc2013-evolution-ad1b3754f7152ecdf76a9f9ddde2a394c0588800.tar.gz gsoc2013-evolution-ad1b3754f7152ecdf76a9f9ddde2a394c0588800.tar.zst gsoc2013-evolution-ad1b3754f7152ecdf76a9f9ddde2a394c0588800.zip |
Bug #545505 - Properly free unused message infos periodically
-rw-r--r-- | mail/e-mail-reader-utils.c | 1 | ||||
-rw-r--r-- | mail/e-mail-reader.c | 6 | ||||
-rw-r--r-- | mail/em-composer-utils.c | 8 | ||||
-rw-r--r-- | mail/em-utils.c | 12 | ||||
-rw-r--r-- | mail/mail-folder-cache.c | 2 | ||||
-rw-r--r-- | mail/message-list.c | 21 |
6 files changed, 27 insertions, 23 deletions
diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c index fb823e543e..d3f0aa42ba 100644 --- a/mail/e-mail-reader-utils.c +++ b/mail/e-mail-reader-utils.c @@ -249,6 +249,7 @@ e_mail_reader_open_selected (EMailReader *reader) } g_free (real_folder_uri); + camel_folder_free_message_info (folder, info); } for (ii = 0; ii < views->len; ii++) { diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index abcdb4d3b5..50849a1d54 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -151,6 +151,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); } @@ -870,7 +872,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) { @@ -2807,6 +2809,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 ()) diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 59e4a4545e..653e64b703 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -1467,23 +1467,23 @@ em_utils_handle_receipt (CamelFolder *folder, const gchar *uid, CamelMimeMessage return; if (camel_message_info_user_flag(info, "receipt-handled")) { - camel_message_info_free(info); + camel_folder_free_message_info (folder, info); return; } if (msg == NULL) { mail_get_messagex(folder, uid, emu_handle_receipt_message, NULL, mail_msg_unordered_push); - camel_message_info_free(info); + camel_folder_free_message_info (folder, info); return; } if ((addr = camel_medium_get_header((CamelMedium *)msg, "Disposition-Notification-To")) == NULL) { - camel_message_info_free(info); + camel_folder_free_message_info (folder, info); return; } camel_message_info_set_user_flag(info, "receipt-handled", TRUE); - camel_message_info_free(info); + camel_folder_free_message_info (folder, info); account = em_utils_guess_account_with_recipients (msg, folder); diff --git a/mail/em-utils.c b/mail/em-utils.c index e0e443331c..91ca5dd6c3 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -409,7 +409,7 @@ em_utils_flag_for_followup (EMailReader *reader, camel_message_info_from (info), camel_message_info_subject (info)); - camel_message_info_free(info); + camel_folder_free_message_info (folder, info); } /* special-case... */ @@ -423,7 +423,7 @@ em_utils_flag_for_followup (EMailReader *reader, if (tags) e_mail_tag_editor_set_tag_list ( E_MAIL_TAG_EDITOR (editor), tags); - camel_message_info_free (info); + camel_folder_free_message_info (folder, info); } } @@ -448,7 +448,7 @@ em_utils_flag_for_followup (EMailReader *reader, camel_message_info_set_user_tag ( info, iter->name, iter->value); - camel_message_info_free (info); + camel_folder_free_message_info (folder, info); } camel_folder_thaw (folder); @@ -490,7 +490,7 @@ em_utils_flag_for_followup_clear (GtkWindow *parent, CamelFolder *folder, GPtrAr camel_message_info_set_user_tag(mi, "follow-up", NULL); camel_message_info_set_user_tag(mi, "due-by", NULL); camel_message_info_set_user_tag(mi, "completed-on", NULL); - camel_message_info_free(mi); + camel_folder_free_message_info (folder, mi); } } camel_folder_thaw (folder); @@ -529,7 +529,7 @@ em_utils_flag_for_followup_completed (GtkWindow *parent, CamelFolder *folder, GP tag = camel_message_info_user_tag(mi, "follow-up"); if (tag && tag[0]) camel_message_info_set_user_tag(mi, "completed-on", now); - camel_message_info_free(mi); + camel_folder_free_message_info (folder, mi); } } camel_folder_thaw (folder); @@ -842,7 +842,7 @@ em_utils_selection_set_urilist(GtkSelectionData *data, CamelFolder *folder, GPtr info = camel_folder_get_message_info(folder, uids->pdata[0]); if (info) { file = g_strdup(camel_message_info_subject(info)); - camel_folder_free_message_info(folder, info); + camel_folder_free_message_info (folder, info); } } diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index 0504bc7049..1bc2d61257 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -452,7 +452,7 @@ folder_changed (CamelObject *o, gpointer event_data, gpointer user_data) subject = NULL; } } - camel_message_info_free (info); + camel_folder_free_message_info (folder, info); } } } diff --git a/mail/message-list.c b/mail/message-list.c index 895bc00191..123c4971aa 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -4134,8 +4134,7 @@ ml_sort_uids_by_tree (MessageList *ml, GPtrArray *uids) g_ptr_array_add (sort_data.sort_columns, data); } - if (uids->len - camel_folder_summary_cache_size (ml->folder->summary) > 50) - camel_folder_summary_reload_from_db (ml->folder->summary, NULL); + camel_folder_summary_prepare_fetch_all (ml->folder->summary, NULL); for (i = 0; i < uids->len; i++) { gchar *uid; @@ -4297,7 +4296,7 @@ regen_list_exec (struct _regen_list_msg *m) e_profile_event_emit("list.threaduids", m->folder->full_name, 0); - /* camel_folder_summary_reload_from_db (m->folder->summary, NULL); */ + /* camel_folder_summary_prepare_fetch_all (m->folder->summary, NULL); */ if (!camel_operation_cancel_check(m->base.cancel)) { /* update/build a new tree */ if (m->dotree) { @@ -4308,18 +4307,18 @@ regen_list_exec (struct _regen_list_msg *m) else m->tree = camel_folder_thread_messages_new (m->folder, uids, m->thread_subject); } else { + CamelException ex; + camel_folder_sort_uids (m->ml->folder, uids); m->summary = g_ptr_array_new (); - if (uids->len > camel_folder_summary_cache_size (m->folder->summary) ) { - CamelException ex; - camel_exception_init (&ex); - camel_folder_summary_reload_from_db (m->folder->summary, &ex); - if (camel_exception_is_set (&ex)) { - g_warning ("Exception while reloading: %s\n", camel_exception_get_description (&ex)); - camel_exception_clear (&ex); - } + camel_exception_init (&ex); + camel_folder_summary_prepare_fetch_all (m->folder->summary, &ex); + if (camel_exception_is_set (&ex)) { + g_warning ("Exception while reloading: %s\n", camel_exception_get_description (&ex)); + camel_exception_clear (&ex); } + for (i = 0; i < uids->len; i++) { info = camel_folder_get_message_info (m->folder, uids->pdata[i]); if (info) |