diff options
-rw-r--r-- | widgets/table/e-tree-model.c | 20 | ||||
-rw-r--r-- | widgets/table/e-tree-sorted.c | 16 | ||||
-rw-r--r-- | widgets/table/e-tree-table-adapter.c | 4 |
3 files changed, 38 insertions, 2 deletions
diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c index 13f203974f..725b4f02fd 100644 --- a/widgets/table/e-tree-model.c +++ b/widgets/table/e-tree-model.c @@ -42,6 +42,8 @@ #define PARENT_TYPE (gtk_object_get_type()) +#define d(x) + static GtkObjectClass *parent_class; enum { @@ -212,6 +214,8 @@ e_tree_model_pre_change (ETreeModel *tree_model) g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); + d(g_print("Emitting pre_change on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type))); + gtk_signal_emit (GTK_OBJECT (tree_model), e_tree_model_signals [PRE_CHANGE]); } @@ -231,6 +235,8 @@ e_tree_model_no_change (ETreeModel *tree_model) g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); + d(g_print("Emitting no_change on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type))); + gtk_signal_emit (GTK_OBJECT (tree_model), e_tree_model_signals [NO_CHANGE]); } @@ -250,6 +256,8 @@ e_tree_model_node_changed (ETreeModel *tree_model, ETreePath node) g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); + d(g_print("Emitting node_changed on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type))); + gtk_signal_emit (GTK_OBJECT (tree_model), e_tree_model_signals [NODE_CHANGED], node); } @@ -269,6 +277,8 @@ e_tree_model_node_data_changed (ETreeModel *tree_model, ETreePath node) g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); + d(g_print("Emitting node_data_changed on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type))); + gtk_signal_emit (GTK_OBJECT (tree_model), e_tree_model_signals [NODE_DATA_CHANGED], node); } @@ -288,6 +298,8 @@ e_tree_model_node_col_changed (ETreeModel *tree_model, ETreePath node, int col) g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); + d(g_print("Emitting node_col_changed on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type))); + gtk_signal_emit (GTK_OBJECT (tree_model), e_tree_model_signals [NODE_COL_CHANGED], node, col); } @@ -308,6 +320,8 @@ e_tree_model_node_inserted (ETreeModel *tree_model, g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); + d(g_print("Emitting node_inserted on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type))); + gtk_signal_emit (GTK_OBJECT (tree_model), e_tree_model_signals [NODE_INSERTED], parent_node, inserted_node); @@ -327,6 +341,8 @@ e_tree_model_node_removed (ETreeModel *tree_model, ETreePath parent_node, ETree g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); + d(g_print("Emitting node_removed on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type))); + gtk_signal_emit (GTK_OBJECT (tree_model), e_tree_model_signals [NODE_REMOVED], parent_node, removed_node, old_position); @@ -345,6 +361,8 @@ e_tree_model_node_deleted (ETreeModel *tree_model, ETreePath deleted_node) g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); + d(g_print("Emitting node_deleted on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type))); + gtk_signal_emit (GTK_OBJECT (tree_model), e_tree_model_signals [NODE_DELETED], deleted_node); @@ -363,6 +381,8 @@ e_tree_model_node_request_collapse (ETreeModel *tree_model, ETreePath collapsed g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); + d(g_print("Emitting node_request_collapse on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type))); + gtk_signal_emit (GTK_OBJECT (tree_model), e_tree_model_signals [NODE_REQUEST_COLLAPSE], collapsed_node); diff --git a/widgets/table/e-tree-sorted.c b/widgets/table/e-tree-sorted.c index 16ee5160eb..7069369a38 100644 --- a/widgets/table/e-tree-sorted.c +++ b/widgets/table/e-tree-sorted.c @@ -1024,13 +1024,19 @@ ets_proxy_node_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets) } ets->priv->root = new_path(NULL, node); e_tree_model_node_changed(E_TREE_MODEL(ets), ets->priv->root); + return; } else { ETreeSortedPath *path = find_path(ets, node); if (path) { free_children(path); - if (!reposition_path(ets, path)) + if (!reposition_path(ets, path)) { e_tree_model_node_changed(E_TREE_MODEL(ets), path); + } else { + e_tree_model_no_change(E_TREE_MODEL(ets)); + } + } else { + e_tree_model_no_change(E_TREE_MODEL(ets)); } } } @@ -1043,6 +1049,8 @@ ets_proxy_node_data_changed (ETreeModel *etm, ETreePath node, ETreeSorted *ets) if (path) { if (!reposition_path(ets, path)) e_tree_model_node_data_changed(E_TREE_MODEL(ets), path); + else + e_tree_model_no_change(E_TREE_MODEL(ets)); } else e_tree_model_no_change(E_TREE_MODEL(ets)); } @@ -1058,6 +1066,8 @@ ets_proxy_node_col_changed (ETreeModel *etm, ETreePath node, int col, ETreeSorte changed = reposition_path(ets, path); if (!changed) e_tree_model_node_col_changed(E_TREE_MODEL(ets), path, col); + else + e_tree_model_no_change(E_TREE_MODEL(ets)); } else e_tree_model_no_change(E_TREE_MODEL(ets)); } @@ -1122,7 +1132,11 @@ ets_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ETr if (child) { ets->priv->root = new_path(NULL, child); e_tree_model_node_inserted(E_TREE_MODEL(ets), NULL, ets->priv->root); + } else { + e_tree_model_no_change(E_TREE_MODEL(ets)); } + } else { + e_tree_model_no_change(E_TREE_MODEL(ets)); } } diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c index a710c51f65..cd376e40e0 100644 --- a/widgets/table/e-tree-table-adapter.c +++ b/widgets/table/e-tree-table-adapter.c @@ -675,8 +675,10 @@ etta_proxy_node_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter *ett int old_size; ETreeTableAdapterNode *node; - if (row == -1) + if (row == -1) { + e_table_model_no_change(E_TABLE_MODEL(etta)); return; + } size = array_size_from_path(etta, path); |