diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2011-09-15 06:38:29 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2011-09-15 06:38:29 +0000 |
commit | 38d7eca153225fd1da44cd8a5f9e7fdf36307a86 (patch) | |
tree | be8f0aa31c1b8f598dc9e8bda79f8f8e58e5a5e0 /src/folderview.c | |
parent | 7e2b849fe899ca25f1f76cba45da969ba4368587 (diff) |
prevent IMAP error caused by sending multiple commands at the same time.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2968 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/folderview.c')
-rw-r--r-- | src/folderview.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/folderview.c b/src/folderview.c index cb7d30a8..69844bb9 100644 --- a/src/folderview.c +++ b/src/folderview.c @@ -2766,6 +2766,10 @@ static void folderview_empty_trash_cb(FolderView *folderview, guint action, if (item->stype != F_TRASH && item->stype != F_JUNK) return; + if (folderview->selection_locked || + summary_is_locked(folderview->summaryview)) return; + folderview->selection_locked = TRUE; + sel_path = gtk_tree_row_reference_get_path(folderview->selected); if (item->stype == F_TRASH) { @@ -2773,6 +2777,7 @@ static void folderview_empty_trash_cb(FolderView *folderview, guint action, _("Delete all messages in the trash folder?"), GTK_STOCK_YES, GTK_STOCK_NO, NULL) != G_ALERTDEFAULT) { gtk_tree_path_free(sel_path); + folderview->selection_locked = FALSE; return; } } else { @@ -2780,11 +2785,14 @@ static void folderview_empty_trash_cb(FolderView *folderview, guint action, _("Delete all messages in the junk folder?"), GTK_STOCK_YES, GTK_STOCK_NO, NULL) != G_ALERTDEFAULT) { gtk_tree_path_free(sel_path); + folderview->selection_locked = FALSE; return; } } + summary_lock(folderview->summaryview); procmsg_empty_trash(item); + summary_unlock(folderview->summaryview); statusbar_pop_all(); folderview_update_item(item, TRUE); trayicon_set_tooltip(NULL); @@ -2796,6 +2804,8 @@ static void folderview_empty_trash_cb(FolderView *folderview, guint action, gtk_widget_grab_focus(folderview->treeview); gtk_tree_path_free(open_path); gtk_tree_path_free(sel_path); + + folderview->selection_locked = FALSE; } static void folderview_remove_mailbox_cb(FolderView *folderview, guint action, |