r16602 - gnucash/trunk/src/gnome-utils - In gtv_set_sort_column, avoid a critical warning and block a signal.

Andreas Köhler andi5 at cvs.gnucash.org
Sun Dec 2 05:35:18 EST 2007


Author: andi5
Date: 2007-12-02 05:35:18 -0500 (Sun, 02 Dec 2007)
New Revision: 16602
Trac: http://svn.gnucash.org/trac/changeset/16602

Modified:
   gnucash/trunk/src/gnome-utils/gnc-tree-view.c
Log:
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.


Modified: gnucash/trunk/src/gnome-utils/gnc-tree-view.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-view.c	2007-12-02 10:35:15 UTC (rev 16601)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-view.c	2007-12-02 10:35:18 UTC (rev 16602)
@@ -937,13 +937,17 @@
   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;
   }
 



More information about the gnucash-changes mailing list