[evolution-data-server] Slow expunge of a maildir folder



commit 9a5a515840f876545207c09f8efccadb389acb06
Author: Milan Crha <mcrha redhat com>
Date:   Mon May 4 16:37:47 2015 +0200

    Slow expunge of a maildir folder

 camel/providers/local/camel-maildir-summary.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c
index 5491ca4..58c60c6 100644
--- a/camel/providers/local/camel-maildir-summary.c
+++ b/camel/providers/local/camel-maildir-summary.c
@@ -779,6 +779,7 @@ maildir_summary_sync (CamelLocalSummary *cls,
        gint i;
        CamelMessageInfo *info;
        CamelMaildirMessageInfo *mdi;
+       GList *removed_uids = NULL;
        gchar *name;
        struct stat st;
        GPtrArray *known_uids;
@@ -807,7 +808,7 @@ maildir_summary_sync (CamelLocalSummary *cls,
                                        camel_index_delete_name (cls->index, camel_message_info_uid (info));
 
                                camel_folder_change_info_remove_uid (changes, camel_message_info_uid (info));
-                               camel_folder_summary_remove ((CamelFolderSummary *) cls, info);
+                               removed_uids = g_list_prepend (removed_uids, (gpointer) camel_pstring_strdup 
(camel_message_info_uid (info)));
                        }
                        g_free (name);
                } else if (mdi && (mdi->info.info.flags & CAMEL_MESSAGE_FOLDER_FLAGGED)) {
@@ -846,6 +847,11 @@ maildir_summary_sync (CamelLocalSummary *cls,
                camel_message_info_unref (info);
        }
 
+       if (removed_uids) {
+               camel_folder_summary_remove_uids (CAMEL_FOLDER_SUMMARY (cls), removed_uids);
+               g_list_free_full (removed_uids, (GDestroyNotify) camel_pstring_free);
+       }
+
        camel_folder_summary_free_array (known_uids);
        camel_operation_pop_message (cancellable);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]