Remove all traces of the AccountGroup data structure. Accounts now

point directly to their parent and have a simple GList of children.
(The old method was alternating data structures in the form Account,
AccountGroup, Account, AccountGroup, etc.)


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15647 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton
2007-02-23 01:23:31 +00:00
parent 82fddb8e2a
commit 6fbada92ec
168 changed files with 2679 additions and 4094 deletions

View File

@@ -35,7 +35,6 @@
#include <unistd.h>
#include "AccountP.h"
#include "Group.h"
#include "Scrub.h"
#include "Scrub3.h"
#include "TransactionP.h"
@@ -1665,47 +1664,11 @@ guint
gnc_book_count_transactions(QofBook *book)
{
guint count = 0;
xaccGroupForEachTransaction(xaccGetAccountGroup(book),
xaccAccountTreeForEachTransaction(gnc_book_get_root_account(book),
counter_thunk, (void*)&count);
return count;
}
/********************************************************************\
\********************************************************************/
/* walk through the splits, looking for any account */
static Account *
get_any_account(const Transaction *trans)
{
GList *node;
if (!trans) return NULL;
for (node = trans->splits; node; node = node->next)
if (((Split *)node->data)->acc)
return ((Split *)node->data)->acc;
return NULL;
}
Account *
xaccGetAccountByName (const Transaction *trans, const char * name)
{
Account *acc;
if (!trans || !name) return NULL;
acc = get_any_account(trans);
return acc ? xaccGetPeerAccountFromName (acc, name) : NULL;
}
/********************************************************************\
\********************************************************************/
Account *
xaccGetAccountByFullName (const Transaction *trans, const char * name)
{
Account *acc;
if (!trans || !name) return NULL;
acc = get_any_account(trans);
return acc ? xaccGetPeerAccountFromFullName (acc, name) : NULL;
}
/********************************************************************\
\********************************************************************/