[Gnucash-changes] Chris Shoemaker's patch to silence gtk errors in

Derek Atkins warlord at cvs.gnucash.org
Thu Dec 23 17:43:44 EST 2004


Log Message:
-----------
Chris Shoemaker's patch to silence gtk errors in dialog-budget-category.c.

	* 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().

Tags:
----
gnucash-gnome2-dev

Modified Files:
--------------
    gnucash:
        ChangeLog
    gnucash/src/gnome:
        dialog-budget-category.c

Revision Data
-------------
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1487.2.153
retrieving revision 1.1487.2.154
diff -LChangeLog -LChangeLog -u -r1.1487.2.153 -r1.1487.2.154
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,13 @@
+2004-12-23  Derek Atkins  <derek at ihtfp.com>
+
+	Chris Shoemaker's patch to silence gtk errors in dialog-budget-category.c:
+	* 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().
+
 2004-12-20  Derek Atkins  <derek at ihtfp.com>
 
 	Stephen Evanchik's Double free bug in GncDenseCal:
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
retrieving revision 1.1.2.2
diff -Lsrc/gnome/dialog-budget-category.c -Lsrc/gnome/dialog-budget-category.c -u -r1.1.2.1 -r1.1.2.2
--- src/gnome/dialog-budget-category.c
+++ src/gnome/dialog-budget-category.c
@@ -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-changes mailing list