changes to start using the query engine

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1153 57a11ea4-9604-0410-9ed3-97b8803252fd
zzzoldfeatures/xacc-12-patch
Linas Vepstas 28 years ago
parent 7cda332f9a
commit 0036179ecc

@ -25,9 +25,10 @@
#include "Account.h"
#include "Group.h"
#include "LedgerUtils.h"
#include "MultiLedger.h"
#include "Query.h"
#include "SplitLedger.h"
#include "LedgerUtils.h"
#include "Transaction.h"
#include "util.h"
@ -329,14 +330,20 @@ xaccLedgerDisplayGeneral (Account *lead_acc, Account **acclist, int ledger_type)
regData->displayed_accounts = accListCopy (acclist);
regData->type = ledger_type;
/* set up the query filter */
regData->query = xaccMallocQuery();
xaccQuerySetAccounts (regData->query, regData->displayed_accounts);
xaccQueryAddAccount (regData->query, regData->leader);
/* add this register to the list of registers */
fullList = ledgerListAdd (fullList, regData);
/******************************************************************\
* The main register window itself *
\******************************************************************/
/* MallocBasicRegister will malloc & initialize the
* register but doesn't do the gui init */
/* MallocBasicRegister will malloc & initialize the register,
* but will not do the gui init */
regData->ledger = xaccMallocSplitRegister (ledger_type);
regData->dirty = 1;
@ -365,7 +372,7 @@ xaccLedgerDisplayRefresh (xaccLedgerDisplay *regData)
* new splits and get them into the system.
*/
xaccSRLoadRegister (regData->ledger,
xaccAccountGetSplitList (regData->leader),
xaccQueryGetSplits (regData->query),
regData->leader);
@ -610,6 +617,8 @@ xaccLedgerDisplayClose (xaccLedgerDisplay *regData)
ledgerListRemove (fullList, regData);
xaccFreeQuery (regData->query);
free(regData);
}

@ -27,6 +27,7 @@
#include "config.h"
#include "Account.h"
#include "Query.h"
#include "splitreg.h"
#include "SplitLedger.h"
#include "Transaction.h"
@ -41,6 +42,7 @@ struct _xaccLedgerDisplay {
Account *leader; /* leading. "master" account */
Account **displayed_accounts; /* The list of accounts shown here */
short numAcc; /* number of accounts in list */
Query *query; /* query engine & filter for displaying */
short type; /* register display type, usually equal to *
* account type, but not always. */

Loading…
Cancel
Save