diff --git a/ChangeLog b/ChangeLog index d06aae1ff8..9f577a6f11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-12-23 Derek Atkins + + 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 Stephen Evanchik's Double free bug in GncDenseCal: diff --git a/src/gnome/dialog-budget-category.c b/src/gnome/dialog-budget-category.c index 1da77ca255..a1c913503b 100644 --- a/src/gnome/dialog-budget-category.c +++ b/src/gnome/dialog-budget-category.c @@ -160,9 +160,11 @@ static void category_to_ui(BudgetCategoryDlg* dlg) /* 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 @@ static void category_dialog_create(BudgetCategoryDlg* dlg) 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 @@ static void category_dialog_create(BudgetCategoryDlg* dlg) /* 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));