From f693c0e8bc3fd53ed0c411f3ae6564b8d28aa2f1 Mon Sep 17 00:00:00 2001 From: Phil Longstaff Date: Sun, 8 Nov 2009 18:59:39 +0000 Subject: [PATCH] When creating an account selector and a commodity list if provider, just duplicate the list rather than making a copy of each commodity. When a copy is made, this copy is stored in the db, but is never deleted. This causes problems (loss of reference from account/tx to commodity) when the file is reloaded. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18407 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/gnome-utils/gnc-account-sel.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/gnome-utils/gnc-account-sel.c b/src/gnome-utils/gnc-account-sel.c index a520c61491..19c437d596 100644 --- a/src/gnome-utils/gnc-account-sel.c +++ b/src/gnome-utils/gnc-account-sel.c @@ -365,24 +365,10 @@ gnc_account_sel_set_acct_filters( GNCAccountSel *gas, GList *typeFilters, GList gas->acctTypeFilters = g_list_copy( typeFilters ); } + /* Save the commodity filter list */ if (commodityFilters) { - src = commodityFilters; - - while (src->data != NULL) - { - //gnc_commodity_clone would have been nice but it expects me to - //insert the clone into a book, which I don't want to do. - commClone = gnc_commodity_new(qof_session_get_book(gnc_get_current_session()), "","","","",1); - gnc_commodity_copy(commClone, src->data); - dest = g_list_prepend(dest, commClone); - if (src->next == NULL) - { - break; - } - src = src->next; - } - gas->acctCommodityFilters = dest; + gas->acctCommodityFilters = g_list_copy(commodityFilters); } gas_populate_list( gas );