summaryrefslogtreecommitdiff
path: root/gtk/gtktreeviewcolumn.c
diff options
context:
space:
mode:
authorKristian Rietveld <kris@gtk.org>2006-05-30 09:29:49 +0000
committerKristian Rietveld <kristian@src.gnome.org>2006-05-30 09:29:49 +0000
commitc4176c97e32d3d4f3545255ab9e162162737eca5 (patch)
tree68a0e60bf4cdec04894e62b0f386c3aed7147e26 /gtk/gtktreeviewcolumn.c
parent416b66f3ab928a72d1bcc7a52e99538844a4a0e9 (diff)
downloadgtk+-c4176c97e32d3d4f3545255ab9e162162737eca5.tar.gz
only check sort column id if connected to sortable model.
2006-05-30 Kristian Rietveld <kris@gtk.org> * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_update_button): only check sort column id if connected to sortable model.
Diffstat (limited to 'gtk/gtktreeviewcolumn.c')
-rw-r--r--gtk/gtktreeviewcolumn.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index 1fe4e3020b..1b22478f21 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -848,6 +848,12 @@ gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column)
GtkWidget *arrow;
GtkWidget *current_child;
GtkArrowType arrow_type = GTK_ARROW_NONE;
+ GtkTreeModel *model;
+
+ if (tree_column->tree_view)
+ model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_column->tree_view));
+ else
+ model = NULL;
/* Create a button if necessary */
if (tree_column->visible &&
@@ -898,9 +904,10 @@ gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column)
"");
}
- if (gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (GTK_TREE_VIEW (tree_column->tree_view)->priv->model),
- &sort_column_id,
- NULL))
+ if (GTK_IS_TREE_SORTABLE (model)
+ && gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model),
+ &sort_column_id,
+ NULL))
{
if (sort_column_id == tree_column->sort_column_id)
{
@@ -944,7 +951,7 @@ gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column)
}
g_object_unref (arrow);
- if (tree_column->sort_column_id >= 0)
+ if (GTK_IS_TREE_SORTABLE (model) && tree_column->sort_column_id >= 0)
gtk_widget_show (arrow);
else
gtk_widget_hide (arrow);