mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
\********************************************************************/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user