From 36211f08ae7e3935d8665f6966dda660dd0fe224 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 20 Feb 2004 20:03:19 +0000 Subject: Delete key should always delete, never undelete (bug #53215). Also fixes a 2004-02-20 Jeffrey Stedfast * em-folder-view.c (emfv_list_key_press): Delete key should always delete, never undelete (bug #53215). Also fixes a bug where uids->len was being accessed after uids had been free'd. svn path=/trunk/; revision=24822 --- mail/ChangeLog | 4 ++++ mail/em-folder-view.c | 9 ++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 5d9709bef8..284e5a6e95 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,9 @@ 2004-02-20 Jeffrey Stedfast + * em-folder-view.c (emfv_list_key_press): Delete key should always + delete, never undelete (bug #53215). Also fixes a bug where + uids->len was being accessed after uids had been free'd. + Fix for bug #53997 * em-folder-view.c (emfv_list_message_selected): Ref the emfv diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index fe37964206..9ba2172470 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -1830,19 +1830,14 @@ emfv_list_key_press(ETree *tree, int row, ETreePath path, int col, GdkEvent *ev, break; case GDK_Delete: case GDK_KP_Delete: - /* If any messages are undeleted, run delete, if all are deleted, run undelete */ - flags = 0; uids = message_list_get_selected(emfv->list); for (i = 0; i < uids->len; i++) { if ((camel_folder_get_message_flags(emfv->folder, uids->pdata[i]) & CAMEL_MESSAGE_DELETED) == 0) break; } message_list_free_uids(emfv->list, uids); - if (i == uids->len) - emfv_popup_undelete(NULL, emfv); - else - emfv_popup_delete(NULL, emfv); - + emfv_popup_delete (NULL, emfv); + if (!message_list_select (emfv->list, MESSAGE_LIST_SELECT_NEXT, 0, 0, FALSE) && emfv->hide_deleted) message_list_select (emfv->list, MESSAGE_LIST_SELECT_PREVIOUS, 0, 0, FALSE); break; -- cgit