gint curnum = 0, total = 0;
gchar *srcpath = NULL;
gboolean full_fetch = FALSE;
+ time_t last_mtime = (time_t)0;
g_return_val_if_fail(dest != NULL, -1);
g_return_val_if_fail(msglist != NULL, -1);
srcpath = folder_item_get_path(msginfo->folder);
dest_need_scan = mh_scan_required(dest->folder, dest);
+ last_mtime = dest->mtime;
total = g_slist_length(msglist);
if (total > 100) {
if (MSG_IS_MOVE(msginfo->flags)) {
+ msginfo->flags.tmp_flags &= ~MSG_MOVE_DONE;
if (move_file(srcfile, destfile, TRUE) < 0) {
FILE_OP_ERROR(srcfile, "move");
if (copy_file(srcfile, destfile, TRUE) < 0) {
g_free(destfile);
goto err_reset_status;
}
+ } else {
+ /* say unlinking's not necessary */
+ msginfo->flags.tmp_flags |= MSG_MOVE_DONE;
}
} else if (copy_file(srcfile, destfile, TRUE) < 0) {
FILE_OP_ERROR(srcfile, "copy");
g_free(srcpath);
mh_write_sequences(dest, TRUE);
- if (!dest_need_scan)
+ if (dest->mtime == last_mtime && !dest_need_scan)
dest->mtime = time(NULL);
if (total > 100) {
static gint mh_remove_msg(Folder *folder, FolderItem *item, gint num)
{
gboolean need_scan = FALSE;
+ time_t last_mtime = (time_t)0;
gchar *file;
g_return_val_if_fail(item != NULL, -1);
g_return_val_if_fail(file != NULL, -1);
need_scan = mh_scan_required(folder, item);
+ last_mtime = item->mtime;
if (g_unlink(file) < 0) {
FILE_OP_ERROR(file, "unlink");
return -1;
}
- if (!need_scan)
+ if (item->mtime == last_mtime && !need_scan)
item->mtime = time(NULL);
g_free(file);
{
gboolean need_scan = FALSE;
gchar *path, *file;
+ time_t last_mtime = (time_t)0;
MsgInfoList *cur;
+ gint total = 0, curnum = 0;
g_return_val_if_fail(item != NULL, -1);
path = folder_item_get_path(item);
need_scan = mh_scan_required(folder, item);
+ last_mtime = item->mtime;
+
+ total = g_slist_length(msglist);
+ if (total > 100) {
+ statusbar_print_all(_("Deleting messages..."));
+ }
for (cur = msglist; cur; cur = cur->next) {
MsgInfo *msginfo = (MsgInfo *)cur->data;
if (msginfo == NULL)
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++;
+ }
+
file = g_strconcat(path, G_DIR_SEPARATOR_S, itos(msginfo->msgnum), NULL);
if (file == NULL)
continue;
g_free(file);
}
- if (!need_scan)
+ if (total > 100) {
+ statusbar_progress_all(0,0,0);
+ statusbar_pop_all();
+ }
+ if (item->mtime == last_mtime && !need_scan)
item->mtime = time(NULL);
g_free(path);