aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-callbacks.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-07-13 03:50:59 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-07-13 03:50:59 +0800
commitd1a65232c9db32b85f693ffa51d86c0b2bc23e17 (patch)
tree275099554517e2caa59d42d14e84b4e0db686777 /mail/mail-callbacks.c
parent459023a2b9238500e0a2c05d72480fe90fea221d (diff)
downloadgsoc2013-evolution-d1a65232c9db32b85f693ffa51d86c0b2bc23e17.tar
gsoc2013-evolution-d1a65232c9db32b85f693ffa51d86c0b2bc23e17.tar.gz
gsoc2013-evolution-d1a65232c9db32b85f693ffa51d86c0b2bc23e17.tar.bz2
gsoc2013-evolution-d1a65232c9db32b85f693ffa51d86c0b2bc23e17.tar.lz
gsoc2013-evolution-d1a65232c9db32b85f693ffa51d86c0b2bc23e17.tar.xz
gsoc2013-evolution-d1a65232c9db32b85f693ffa51d86c0b2bc23e17.tar.zst
gsoc2013-evolution-d1a65232c9db32b85f693ffa51d86c0b2bc23e17.zip
Force-hide all deleted messages before expunging. (expunged_folder):
2001-07-12 Jeffrey Stedfast <fejj@ximian.com> * mail-callbacks.c (expunge_folder): Force-hide all deleted messages before expunging. (expunged_folder): Restore the user's "hide deleted messages" preference. svn path=/trunk/; revision=11056
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r--mail/mail-callbacks.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index f67f1a08a1..0800886a7f 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -1618,32 +1618,47 @@ previous_flagged_msg (GtkWidget *button, gpointer user_data)
CAMEL_MESSAGE_FLAGGED, CAMEL_MESSAGE_FLAGGED);
}
+struct _expunged_folder_data {
+ FolderBrowser *fb;
+ gboolean hidedeleted;
+};
+
static void
expunged_folder (CamelFolder *f, void *data)
{
- FolderBrowser *fb = data;
-
+ FolderBrowser *fb = ((struct _expunged_folder_data *) data)->fb;
+ gboolean hidedeleted = ((struct _expunged_folder_data *) data)->hidedeleted;
+
fb->expunging = NULL;
+ message_list_set_hidedeleted (fb->message_list, hidedeleted);
+
+ g_free (data);
}
void
expunge_folder (BonoboUIComponent *uih, void *user_data, const char *path)
{
- FolderBrowser *fb = FOLDER_BROWSER(user_data);
-
- if (fb->folder
- && (fb->expunging == NULL
- || fb->folder != fb->expunging)) {
+ FolderBrowser *fb = FOLDER_BROWSER (user_data);
+
+ if (fb->folder && (fb->expunging == NULL || fb->folder != fb->expunging)) {
+ struct _expunged_folder_data *data;
CamelMessageInfo *info;
-
+
+ data = g_malloc (sizeof (*data));
+ data->fb = fb;
+ data->hidedeleted = fb->message_list->hidedeleted;
+
+ /* hide the deleted messages so user can't click on them while we expunge */
+ message_list_set_hidedeleted (fb->message_list, TRUE);
+
/* Only blank the mail display if the message being
viewed is one of those to be expunged */
info = camel_folder_get_message_info (fb->folder, fb->loaded_uid);
if (info->flags & CAMEL_MESSAGE_DELETED)
mail_display_set_message (fb->mail_display, NULL);
-
+
fb->expunging = fb->folder;
- mail_expunge_folder(fb->folder, expunged_folder, fb);
+ mail_expunge_folder (fb->folder, expunged_folder, data);
}
}