From 03b3618408f037589882655e4b97e7b75787b756 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 3 Jul 2000 01:17:49 +0000 Subject: New functions to freeze and thaw a folder (to prevent message/folder * camel-folder.c (camel_folder_freeze, camel_folder_thaw): New functions to freeze and thaw a folder (to prevent message/folder changed signals in the middle of a long series of operations). (camel_folder_class_init): Change signals to GTK_RUN_FIRST. (message_changed, folder_changed): Add default implementations that stop the emission and record info for later if the folder is frozen. * providers/mbox/camel-mbox-folder.c (mbox_sync): leftover fixes from the close->sync change: don't destroy the ibex, summary, and search when syncing. svn path=/trunk/; revision=3863 --- camel/providers/mbox/camel-mbox-folder.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'camel/providers/mbox/camel-mbox-folder.c') diff --git a/camel/providers/mbox/camel-mbox-folder.c b/camel/providers/mbox/camel-mbox-folder.c index 09b718a1de..6efa93a42c 100644 --- a/camel/providers/mbox/camel-mbox-folder.c +++ b/camel/providers/mbox/camel-mbox-folder.c @@ -245,19 +245,10 @@ mbox_sync (CamelFolder *folder, gboolean expunge, CamelException *ex) camel_mbox_summary_sync (mbox_folder->summary, FALSE, ex); /* save index */ - if (mbox_folder->index) { - ibex_close(mbox_folder->index); - mbox_folder->index = NULL; - } - if (mbox_folder->summary) { + if (mbox_folder->index) + ibex_save(mbox_folder->index); + if (mbox_folder->summary) camel_folder_summary_save (CAMEL_FOLDER_SUMMARY (mbox_folder->summary)); - gtk_object_unref (GTK_OBJECT (mbox_folder->summary)); - mbox_folder->summary = NULL; - } - if (mbox_folder->search) { - gtk_object_unref (GTK_OBJECT (mbox_folder->search)); - mbox_folder->search = NULL; - } } static void @@ -341,7 +332,8 @@ mbox_append_message (CamelFolder *folder, CamelMimeMessage *message, CamelExcept gtk_object_unref (GTK_OBJECT (output_stream)); /* force a summary update - will only update from the new position, if it can */ - camel_mbox_summary_update (mbox_folder->summary, seek); + if (camel_mbox_summary_update (mbox_folder->summary, seek) == 0) + gtk_signal_emit_by_name (GTK_OBJECT (folder), "folder_changed", 0); return; fail: -- cgit v1.2.3