[anjal] More saner Trash/Junk implementation. Undelete/unjunk works. View looks
- From: Srinivasa Ragavan <sragavan src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [anjal] More saner Trash/Junk implementation. Undelete/unjunk works. View looks
- Date: Wed, 26 Aug 2009 06:36:32 +0000 (UTC)
commit 845f3faa47a6c9979d52bcfa2b0a482872b74fa9
Author: Srinivasa Ragavan <sragavan novell com>
Date: Wed Aug 26 12:05:34 2009 +0530
More saner Trash/Junk implementation. Undelete/unjunk works. View looks
better.
src/em-tree-store.c | 33 +++++++++++++++++++++++++--------
1 files changed, 25 insertions(+), 8 deletions(-)
---
diff --git a/src/em-tree-store.c b/src/em-tree-store.c
index 9084dc9..2424297 100644
--- a/src/em-tree-store.c
+++ b/src/em-tree-store.c
@@ -1072,15 +1072,31 @@ emts_folder_changed_idle(void *data)
iter.stamp = emts->stamp;
iter.user_data = node;
- 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);
+ if (emts->trash || emts->junk) {
+ if ((emts->trash && !(camel_message_info_flags(mi) & CAMEL_MESSAGE_DELETED)) ||
+ (emts->junk && !(camel_message_info_flags(mi) & CAMEL_MESSAGE_JUNK))) {
+ emts_remove_info(emts, uid, f);
+ }
+ } else {
+
+ if (camel_message_info_flags(mi) & CAMEL_MESSAGE_DELETED ||
+ camel_message_info_flags(mi) & CAMEL_MESSAGE_JUNK)
+ 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;
+ if (emts->trash || emts->junk) {
+ if ((emts->trash && (camel_message_info_flags(mi) & CAMEL_MESSAGE_DELETED)) ||
+ (emts->junk && (camel_message_info_flags(mi) & CAMEL_MESSAGE_JUNK)))
+ resort = emts_insert_info_incr(emts, mi, f) || resort;
+
+ } else {
+ resort = emts_insert_info_incr(emts, mi, f) || resort;
+ }
}
camel_message_info_free (mi);
@@ -1154,7 +1170,8 @@ em_tree_store_add_folder (EMTreeStore *emts, CamelFolder *folder, const char *ex
}
for (j=0; j<uids->len; j++) {
CamelMessageInfo *mi = camel_folder_get_message_info (f->folder, uids->pdata[j]);
- emts_insert_info_base(emts, mi, f);
+ if (mi)
+ emts_insert_info_base(emts, mi, f);
}
if (prune) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]