[Commits] mailmbox_folder.c 1.10.2.10 1.10.2.11
colin at claws-mail.org
colin at claws-mail.org
Wed Sep 12 12:10:23 CEST 2012
Update of /home/claws-mail/plugins/mailmbox/src
In directory srv:/tmp/cvs-serv14078/src
Modified Files:
Tag: gtk2
mailmbox_folder.c
Log Message:
2012-09-12 [colin] 1.14.7cvs5
* src/mailmbox_folder.c
Fix bug #2109, "implement remove_msgs callback for MailMBOX"
Patch mostly by Cindy Matthews.
Index: mailmbox_folder.c
===================================================================
RCS file: /home/claws-mail/plugins/mailmbox/src/mailmbox_folder.c,v
retrieving revision 1.10.2.10
retrieving revision 1.10.2.11
diff -u -d -r1.10.2.10 -r1.10.2.11
--- mailmbox_folder.c 3 Oct 2010 11:56:13 -0000 1.10.2.10
+++ mailmbox_folder.c 12 Sep 2012 10:10:21 -0000 1.10.2.11
@@ -44,7 +44,9 @@
#include "folder.h"
#include "procmsg.h"
#include "procheader.h"
+#include "statusbar.h"
#include "utils.h"
+#include "gtkutils.h"
#include "localfolder.h"
#include "mailmbox.h"
#include "mailmbox_folder.h"
@@ -87,7 +89,7 @@
MsgInfoList *msglist, GHashTable *relation);
static gint claws_mailmbox_remove_msg(Folder *folder, FolderItem *item, gint num);
-
+static gint claws_mailmbox_remove_msgs( Folder *folder, FolderItem *item, MsgInfoList *msglist, GRelation *relation );
static gint claws_mailmbox_remove_all_msg(Folder *folder, FolderItem *item);
static FolderItem *claws_mailmbox_create_folder(Folder *folder, FolderItem *parent,
@@ -152,6 +154,7 @@
claws_mailmbox_class.copy_msg = s_claws_mailmbox_copy_msg;
claws_mailmbox_class.copy_msgs = claws_mailmbox_copy_msgs;
claws_mailmbox_class.remove_msg = claws_mailmbox_remove_msg;
+ claws_mailmbox_class.remove_msgs = claws_mailmbox_remove_msgs;
claws_mailmbox_class.remove_all_msg = claws_mailmbox_remove_all_msg;
}
return &claws_mailmbox_class;
@@ -716,9 +719,7 @@
munmap(data, len);
close(fd);
-
- claws_mailmbox_sync(mbox);
-
+
r = claws_mailmbox_parse_additionnal(mbox, &cur_token);
if (r != MAILMBOX_NO_ERROR) {
debug_print("claws_mailmbox_parse_additionnal failed with %d\n", r);
@@ -745,7 +746,9 @@
err:
continue;
}
-
+
+ claws_mailmbox_sync(mbox);
+
carray_free(append_list);
claws_mailmbox_write_unlock(mbox);
@@ -814,6 +817,57 @@
return 0;
}
+static gint
+claws_mailmbox_remove_msgs( Folder *folder, FolderItem *item,
+ MsgInfoList *msglist, GRelation *relation )
+{
+ struct claws_mailmbox_folder *mbox;
+ int r;
+ gint total = 0, curnum = 0;
+
+ g_return_val_if_fail( item!=NULL, -1 );
+ mbox=get_mbox(item,0);
+ g_return_val_if_fail( mbox!=NULL, -1 );
+
+ total = g_slist_length(msglist);
+ if (total > 100) {
+ statusbar_print_all(_("Deleting messages..."));
+ }
+
+ MsgInfoList *cur;
+ for( cur=msglist; cur; cur=cur->next )
+ {
+ MsgInfo *msginfo=(MsgInfo*) cur->data;
+ if( !msginfo )
+ {
+ continue;
+ }
+ if( MSG_IS_MOVE(msginfo->flags) && MSG_IS_MOVE_DONE(msginfo->flags) )
+ {
+ msginfo->flags.tmp_flags&=~MSG_MOVE_DONE;
+ continue;
+ }
+ if (total > 100) {
+ statusbar_progress_all(curnum, total, 100);
+ if (curnum % 100 == 0)
+ GTK_EVENTS_FLUSH();
+ curnum++;
+ }
+ claws_mailmbox_delete_msg(mbox,msginfo->msgnum);
+ }
+
+ /* Fix for bug 1434
+ */
+ claws_mailmbox_expunge(mbox);
+ if (total > 100) {
+ statusbar_progress_all(0,0,0);
+ statusbar_pop_all();
+ }
+
+ return r;
+}
+
+
static gint claws_mailmbox_remove_all_msg(Folder *folder, FolderItem *item)
{
struct claws_mailmbox_folder * mbox;
More information about the Commits
mailing list