changeset 1628:738b70daa3af

do not call signal handler from vdtree_row_expanded it fixes tree view for user-entered hidden directories
author nadvornik
date Sat, 06 Jun 2009 15:33:56 +0000
parents 909bf83bf9a4
children f8503019ac38
files src/view_dir_tree.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/view_dir_tree.c	Sat Jun 06 11:15:09 2009 +0000
+++ b/src/view_dir_tree.c	Sat Jun 06 15:33:56 2009 +0000
@@ -40,6 +40,7 @@
 };
 
 
+static void vdtree_row_expanded(GtkTreeView *treeview, GtkTreeIter *iter, GtkTreePath *tpath, gpointer data);
 
 
 /*
@@ -126,13 +127,19 @@
 
 	store = gtk_tree_view_get_model(GTK_TREE_VIEW(vd->view));
 	tpath = gtk_tree_model_get_path(store, iter);
+
 	if (expand)
 		{
+		/* block signal handler, icon is set here, the caller of vdtree_expand_by_iter must make sure
+		   that the iter is populated */
+		g_signal_handlers_block_by_func(G_OBJECT(vd->view), vdtree_row_expanded, vd);
 		gtk_tree_view_expand_row(GTK_TREE_VIEW(vd->view), tpath, FALSE);
 		vdtree_icon_set_by_iter(vd, iter, vd->pf->open);
+		g_signal_handlers_unblock_by_func(G_OBJECT(vd->view), vdtree_row_expanded, vd);
 		}
 	else
 		{
+		/* signal handler vdtree_row_collapsed is called, it updates the icon */
 		gtk_tree_view_collapse_row(GTK_TREE_VIEW(vd->view), tpath);
 		}
 	gtk_tree_path_free(tpath);