From 773c44f34acfbf279907c31e91ead8a69d0912cb Mon Sep 17 00:00:00 2001 From: Crispin Flowerday Date: Tue, 17 Jan 2006 19:35:34 +0000 Subject: When adding a column that can be sorted on, re-create the sort model, so 2006-01-17 Crispin Flowerday * lib/widgets/ephy-node-view.c (ephy_node_view_add_column): When adding a column that can be sorted on, re-create the sort model, so that it sets up the sort method correctly. Fixes bug #320686 --- ChangeLog | 8 ++++++++ lib/widgets/ephy-node-view.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 09229146e..8d164df2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-01-17 Crispin Flowerday + + * lib/widgets/ephy-node-view.c (ephy_node_view_add_column): + + When adding a column that can be sorted on, re-create the + sort model, so that it sets up the sort method correctly. + Fixes bug #320686 + 2006-01-17 Crispin Flowerday * embed/ephy-embed-event.c: (ephy_embed_event_get_property): diff --git a/lib/widgets/ephy-node-view.c b/lib/widgets/ephy-node-view.c index 362c77ccb..cec722019 100644 --- a/lib/widgets/ephy-node-view.c +++ b/lib/widgets/ephy-node-view.c @@ -1260,6 +1260,14 @@ ephy_node_view_add_column (EphyNodeView *view, if (flags & EPHY_NODE_VIEW_SORTABLE) { + /* Now we have created a new column, re-create the + * sort model, but ensure that the set_sort function + * hasn't been called, see bug #320686 */ + g_assert (view->priv->sort_column == -1); + g_object_unref (view->priv->sortmodel); + view->priv->sortmodel = ephy_tree_model_sort_new (view->priv->filtermodel); + gtk_tree_view_set_model (GTK_TREE_VIEW (view), GTK_TREE_MODEL (view->priv->sortmodel)); + gtk_tree_view_column_set_sort_column_id (gcolumn, column); } -- cgit v1.2.3