[PATCH] Silence gtk errors in dialog-budget-category.c

Chris Shoemaker c.shoemaker at cox.net
Wed Dec 22 19:44:23 EST 2004


Oops.  Now with patch.

On Wed, Dec 22, 2004 at 07:34:04PM -0500, Chris Shoemaker wrote:
>   * we don't need to get our own account TreeModel and set it to our
> new account TreeView, because gnc_tree_view_account_new gives us a
> TreeView with the global account TreeModel already set.  Plus, it
> already has the right TreeModelSort interface, which we are counting
> on.
>   * check for NULL before trying to gtk_entry_set_text().
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
-------------- next part --------------
Index: dialog-budget-category.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/Attic/dialog-budget-category.c,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 dialog-budget-category.c
--- dialog-budget-category.c	5 Aug 2004 21:03:27 -0000	1.1.2.1
+++ dialog-budget-category.c	23 Dec 2004 05:06:02 -0000
@@ -160,9 +160,11 @@
     /* Set the name and description. */
     gtk_entry_set_text(dlg->name_entry, 
             gnc_budget_category_get_name(dlg->category));
-    gtk_entry_set_text(dlg->description_entry, 
-            gnc_budget_category_get_description(dlg->category));
-
+    
+    if (gnc_budget_category_get_description(dlg->category)) {
+      gtk_entry_set_text(dlg->description_entry, 
+			 gnc_budget_category_get_description(dlg->category));
+    }
     /* Set the value. */
     value = gnc_numeric_to_double(
                 gnc_budget_category_get_value(dlg->category));
@@ -218,7 +220,6 @@
     GtkWidget *box;
     GtkWidget* ok_button;
     GtkWidget* cancel_button;
-    GtkTreeModel *model;
     GtkTreeSelection* selection;
     
     /* Load the glade xml file and create the widget. */
@@ -250,12 +251,9 @@
 
 
     /* Set up the related accounts view. */
-    model = gnc_tree_model_account_new (gnc_book_get_group (gnc_get_current_book ()));
-    
     box = glade_xml_get_widget (xml, "related_accounts_scroll");
     dlg->relatedView = gnc_tree_view_account_new(FALSE);
     gtk_container_add(GTK_CONTAINER(box), GTK_WIDGET(dlg->relatedView));
-    gtk_tree_view_set_model (dlg->relatedView, model);
     
     gnc_tree_view_account_configure_columns(GNC_TREE_VIEW_ACCOUNT(dlg->relatedView), NULL);
     selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(dlg->relatedView));


More information about the gnucash-devel mailing list