aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-06-30 05:31:44 +0800
committerChris Lahey <clahey@src.gnome.org>2000-06-30 05:31:44 +0800
commit5ca5da26b5db7fe7baf622a34d9b98227ecead4a (patch)
treea6dd603c58c26bb66a19c4b27f4077277923a916 /mail/mail-ops.c
parentc216b49da2319a3cc36297c17193201e5f290301 (diff)
downloadgsoc2013-evolution-5ca5da26b5db7fe7baf622a34d9b98227ecead4a.tar
gsoc2013-evolution-5ca5da26b5db7fe7baf622a34d9b98227ecead4a.tar.gz
gsoc2013-evolution-5ca5da26b5db7fe7baf622a34d9b98227ecead4a.tar.bz2
gsoc2013-evolution-5ca5da26b5db7fe7baf622a34d9b98227ecead4a.tar.lz
gsoc2013-evolution-5ca5da26b5db7fe7baf622a34d9b98227ecead4a.tar.xz
gsoc2013-evolution-5ca5da26b5db7fe7baf622a34d9b98227ecead4a.tar.zst
gsoc2013-evolution-5ca5da26b5db7fe7baf622a34d9b98227ecead4a.zip
Handle multiple deletes (change by Peter Williams.)
2000-06-29 Christopher James Lahey <clahey@helixcode.com> * mail-ops.c: Handle multiple deletes (change by Peter Williams.) svn path=/trunk/; revision=3809
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c44
1 files changed, 27 insertions, 17 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index d7f764b214..b237c3db32 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -65,6 +65,9 @@ typedef struct rsm_s {
} rsm_t;
static void
+real_delete_msg( int model_row, gpointer user_data );
+
+static void
real_fetch_mail( gpointer user_data );
static void
@@ -610,27 +613,23 @@ forward_msg (GtkWidget *button, gpointer user_data)
gtk_widget_show (GTK_WIDGET (composer));
}
-void
-delete_msg (GtkWidget *button, gpointer user_data)
+static void
+real_delete_msg( int model_row, gpointer user_data )
{
FolderBrowser *fb = user_data;
MessageList *ml = fb->message_list;
+ CamelMessageInfo *info;
CamelException ex;
- guint32 flags;
-
- if (!fb->mail_display->current_message)
- return;
camel_exception_init (&ex);
-
- flags = camel_folder_get_message_flags (fb->folder, ml->selected_uid,
- &ex);
- if (!camel_exception_is_set (&ex)) {
- /* Toggle the deleted flag without touching other flags. */
- camel_folder_set_message_flags (fb->folder, ml->selected_uid,
- CAMEL_MESSAGE_DELETED,
- ~flags, &ex);
- }
+
+ g_assert( model_row < ml->summary_table->len );
+ info = ml->summary_table->pdata[model_row];
+
+ /* Toggle the deleted flag without touching other flags. */
+ camel_folder_set_message_flags (fb->folder, info->uid,
+ CAMEL_MESSAGE_DELETED,
+ ~(info->flags), &ex);
if (camel_exception_is_set (&ex)) {
mail_exception_dialog ("Could not toggle deleted flag",
@@ -639,10 +638,21 @@ delete_msg (GtkWidget *button, gpointer user_data)
return;
}
+}
+
+void
+delete_msg (GtkWidget *button, gpointer user_data)
+{
+ FolderBrowser *fb = user_data;
+ MessageList *ml = fb->message_list;
+ int cursor = e_table_get_cursor_row(ml->etable);
+
+ e_table_selected_row_foreach( ml->etable, real_delete_msg, fb );
/* Move the cursor down a row... FIXME: should skip other
- * deleted messages.
+ * deleted messages. FIXME: this implementation is a bit
+ * questionable
*/
- e_table_set_cursor_row (E_TABLE (ml->etable), ml->selected_row + 1);
+ e_table_set_cursor_row (E_TABLE (ml->etable), cursor + 1);
}
static void real_expunge_folder( gpointer user_data )