[anjal] BUGFIX: GNOME Bugzilla #590109 - Delete mail should move cursor to next mail



commit 2017bfaa9863ba142171553dea7b7fd494c6816e
Author: Srinivasa Ragavan <sragavan novell com>
Date:   Wed Jul 29 15:59:43 2009 +0530

    BUGFIX: GNOME Bugzilla #590109 - Delete mail should move cursor to next mail

 src/em-tree-store.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/src/em-tree-store.c b/src/em-tree-store.c
index c261069..b526f99 100644
--- a/src/em-tree-store.c
+++ b/src/em-tree-store.c
@@ -1027,6 +1027,8 @@ emts_folder_changed_idle(void *data)
 	f = (struct _emts_folder *)p->folders.head;
 	n = f->next;
 	while (n) {
+
+		d(printf("Changed added=%d removed=%d changed=%d\n", f->changes->uid_added->len, f->changes->uid_removed->len, f->changes->uid_changed->len));
 		for (i=0;i<f->changes->uid_added->len;i++) {
 			CamelMessageInfo *mi;
 			const char *uid = f->changes->uid_added->pdata[i];
@@ -1058,11 +1060,19 @@ emts_folder_changed_idle(void *data)
 
 				iter.stamp = emts->stamp;
 				iter.user_data = node;
-
-				path = emts_get_path((GtkTreeModel*)emts, &iter);
-				gtk_tree_model_row_changed((GtkTreeModel*)emts, path, &iter);
-				gtk_tree_path_free(path);
+				
+				if (camel_message_info_flags(mi) & CAMEL_MESSAGE_DELETED)
+					emts_remove_info(emts, uid, f);
+				else {
+					path = emts_get_path((GtkTreeModel*)emts, &iter);
+					gtk_tree_model_row_changed((GtkTreeModel*)emts, path, &iter);
+					gtk_tree_path_free(path);
+				}
+			} else {
+				resort = emts_insert_info_incr(emts, mi, f) || resort;
 			}
+
+			camel_message_info_free (mi);
 		}
 
 		camel_folder_change_info_clear(f->changes);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]