From d8dca024bf7b44da64b1a7dd0ca797bb7855f8ed Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Thu, 28 Dec 2000 22:41:04 +0000 Subject: [PATCH] Use xaccGroupGetAccountList instead of old api. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3364 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/engine/io-gncxml-w.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/engine/io-gncxml-w.c b/src/engine/io-gncxml-w.c index f9980d24e0..c9b636adae 100644 --- a/src/engine/io-gncxml-w.c +++ b/src/engine/io-gncxml-w.c @@ -718,32 +718,33 @@ xml_add_account_restorer(xmlNodePtr p, Account* a) { { AccountGroup *g = xaccAccountGetChildren(a); if(g) { - guint32 num_accounts = xaccGroupGetNumAccounts(g); - guint32 i = 0; - while(i < num_accounts) { - Account *current_acc = xaccGroupGetAccount(g, i); + GList *list = xaccGroupGetAccountList (g); + GList *node; - if(!xml_add_account_restorer(p, current_acc)) return(FALSE); - i++; + for (node = list; node; node = node->next) { + Account *current_acc = node->data; + + if(!xml_add_account_restorer(p, current_acc)) + return(FALSE); } } } return(TRUE); } - + static gboolean xml_add_account_restorers(xmlNodePtr p, AccountGroup *g) { - guint32 i = 0; - guint32 num_accounts; + GList *list; + GList *node; if(!p) return(FALSE); if(!g) return(FALSE); - num_accounts = xaccGroupGetNumAccounts(g); - while(i < num_accounts) { - Account *current_acc = xaccGroupGetAccount(g, i); + list = xaccGroupGetAccountList (g); + + for (node = list; node; node = node->next) { + Account *current_acc = node->data; xml_add_account_restorer(p, current_acc); - i++; } return(TRUE); }