aboutsummaryrefslogtreecommitdiffstats
path: root/mail/message-list.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-06-19 04:49:16 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-06-19 04:49:16 +0800
commitc0f7c70b8a268748a3f6f05a8ecd3f1982258b90 (patch)
tree407943170273e3fa7f4ae5aa2932d3b00e5dccfa /mail/message-list.c
parent01d1976e826cb72622eb997032d029d15992996b (diff)
downloadgsoc2013-evolution-c0f7c70b8a268748a3f6f05a8ecd3f1982258b90.tar.gz
gsoc2013-evolution-c0f7c70b8a268748a3f6f05a8ecd3f1982258b90.tar.zst
gsoc2013-evolution-c0f7c70b8a268748a3f6f05a8ecd3f1982258b90.zip
New convenience function to find the first parent node that is visible and
2002-06-18 Jeffrey Stedfast <fejj@ximian.com> * message-list.c (message_list_change_first_visible_parent): New convenience function to find the first parent node that is visible and emit a changed signal on it. (main_folder_changed): If a message changed, call change_first_visible_parent() in case we are in a collapsed thread so that our first visible parent gets updated as well. Fixes bug #26263. * component-factory.c (storage_remove_folder): Simplify the error checking. svn path=/trunk/; revision=17228
Diffstat (limited to 'mail/message-list.c')
-rw-r--r--mail/message-list.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/mail/message-list.c b/mail/message-list.c
index 1d5c4595d4..a96b2ed473 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -1894,6 +1894,22 @@ build_flat (MessageList *ml, GPtrArray *summary, CamelFolderChangeInfo *changes)
}
+static void
+message_list_change_first_visible_parent (MessageList *ml, ETreePath node)
+{
+ ETreePath first_visible = NULL;
+
+ while (node && (node = e_tree_model_node_get_parent (ml->model, node))) {
+ if (!e_tree_node_is_expanded (ml->tree, node))
+ first_visible = node;
+ }
+
+ if (first_visible != NULL) {
+ e_tree_model_pre_change (ml->model);
+ e_tree_model_node_data_changed (ml->model, first_visible);
+ }
+}
+
#ifndef BROKEN_ETREE
static void
@@ -1942,6 +1958,8 @@ build_flat_diff(MessageList *ml, CamelFolderChangeInfo *changes)
if (node) {
e_tree_model_pre_change (ml->model);
e_tree_model_node_data_changed (ml->model, node);
+
+ message_list_change_first_visible_parent (ml, node)
}
}
@@ -1955,6 +1973,7 @@ build_flat_diff(MessageList *ml, CamelFolderChangeInfo *changes)
}
#endif /* ! BROKEN_ETREE */
+
static void
main_folder_changed (CamelObject *o, gpointer event_data, gpointer user_data)
{
@@ -2016,6 +2035,8 @@ main_folder_changed (CamelObject *o, gpointer event_data, gpointer user_data)
if (node) {
e_tree_model_pre_change (ml->model);
e_tree_model_node_data_changed (ml->model, node);
+
+ message_list_change_first_visible_parent (ml, node);
}
}
@@ -2032,14 +2053,14 @@ folder_changed (CamelObject *o, gpointer event_data, gpointer user_data)
{
CamelFolderChangeInfo *changes;
MessageList *ml = MESSAGE_LIST (user_data);
-
+
if (event_data) {
changes = camel_folder_change_info_new();
camel_folder_change_info_cat(changes, (CamelFolderChangeInfo *)event_data);
} else {
changes = NULL;
}
-
+
mail_async_event_emit(ml->async_event, MAIL_ASYNC_GUI, (MailAsyncFunc)main_folder_changed, o, changes, user_data);
}