aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-tree.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-12-03 04:57:23 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-12-03 04:57:23 +0800
commita0b2261343a7938b4c85f8659216b9df1c81769b (patch)
tree6303a197cee9b5efb0e4e24363de81b05470f456 /mail/em-folder-tree.c
parent3db4f804fda057ff60bc019b3ce7082134eb80fc (diff)
downloadgsoc2013-evolution-a0b2261343a7938b4c85f8659216b9df1c81769b.tar.gz
gsoc2013-evolution-a0b2261343a7938b4c85f8659216b9df1c81769b.tar.zst
gsoc2013-evolution-a0b2261343a7938b4c85f8659216b9df1c81769b.zip
Connect to the loading row signal. (loading_row_cb): Expand the path if
2003-12-02 Jeffrey Stedfast <fejj@ximian.com> * em-folder-tree.c (em_folder_tree_new_with_model): Connect to the loading row signal. (loading_row_cb): Expand the path if needed. (em_folder_tree_destroy): Disconnect from the loading-row signal. * em-folder-tree-model.c (em_folder_tree_model_class_init): Define the loading-row signal. (em_folder_tree_model_set_folder_info): emit the loading-row signal. svn path=/trunk/; revision=23589
Diffstat (limited to 'mail/em-folder-tree.c')
-rw-r--r--mail/em-folder-tree.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index 00692595b1..42ffcf0f1d 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -74,6 +74,8 @@ struct _EMFolderTreePrivate {
guint save_state_id;
+ guint loading_row_id;
+
/* dnd signal ids */
guint ddr, rdp, rd, ddg, ddd;
};
@@ -315,6 +317,11 @@ em_folder_tree_destroy (GtkObject *obj)
{
struct _EMFolderTreePrivate *priv = ((EMFolderTree *) obj)->priv;
+ if (priv->loading_row_id != 0) {
+ g_signal_handler_disconnect (priv->model, priv->loading_row_id);
+ priv->loading_row_id = 0;
+ }
+
if (priv->ddr != 0) {
g_signal_handler_disconnect (priv->model, priv->ddr);
priv->ddr = 0;
@@ -907,6 +914,33 @@ expand_node (const char *key, gpointer value, EMFolderTree *emft)
}
+static void
+loading_row_cb (EMFolderTreeModel *model, GtkTreePath *tree_path, GtkTreeIter *iter, EMFolderTree *emft)
+{
+ struct _EMFolderTreeModelStoreInfo *si;
+ CamelStore *store;
+ EAccount *account;
+ char *path, *key;
+
+ gtk_tree_model_get ((GtkTreeModel *) model, iter,
+ COL_STRING_FOLDER_PATH, &path,
+ COL_POINTER_CAMEL_STORE, &store,
+ -1);
+
+ si = g_hash_table_lookup (model->store_hash, store);
+ if ((account = mail_config_get_account_by_name (si->display_name))) {
+ key = g_strdup_printf ("%s:%s", account->uid, path);
+ } else {
+ key = g_strdup_printf ("%s:%s", si->display_name, path);
+ }
+
+ if (em_folder_tree_model_get_expanded (model, key))
+ gtk_tree_view_expand_to_path (emft->priv->treeview, tree_path);
+
+ g_free (key);
+}
+
+
GtkWidget *
em_folder_tree_new_with_model (EMFolderTreeModel *model)
{
@@ -919,6 +953,8 @@ em_folder_tree_new_with_model (EMFolderTreeModel *model)
/* FIXME: this sucks... */
g_hash_table_foreach (model->expanded, (GHFunc) expand_node, emft);
+ emft->priv->loading_row_id = g_signal_connect (model, "loading-row", G_CALLBACK (loading_row_cb), emft);
+
return (GtkWidget *) emft;
}