In gtv_set_sort_column, avoid a critical warning and block a signal.

The critical warning happens when opening the security editor and the
model underlying the tree view has not been created yet.  Also, do not
send the sort column (back) to the gconf storage.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16602 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Andreas Köhler 2007-12-02 10:35:18 +00:00
parent ebe89766e5
commit da9e731b7a

View File

@ -937,13 +937,17 @@ gnc_tree_view_set_sort_column (GncTreeView *view,
gint model_column, current;
s_model = gtk_tree_view_get_model(GTK_TREE_VIEW(view));
if (!s_model)
return;
priv = GNC_TREE_VIEW_GET_PRIVATE(view);
column = gnc_tree_view_find_column_by_name(view, name);
if (!column) {
g_signal_handler_block(s_model, priv->sort_column_changed_cb_id);
gtk_tree_sortable_set_sort_column_id(
GTK_TREE_SORTABLE(s_model), GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
GTK_SORT_ASCENDING);
g_signal_handler_unblock(s_model, priv->sort_column_changed_cb_id);
return;
}