From 48772fc3d78861c340bb34d5339ee192e76ed033 Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Sat, 7 Jul 2001 10:07:37 +0000 Subject: [PATCH] 2001-07-07 Dave Peticolas * src/test/gnc-test-stuff.c (get_random_query): not so many terms * src/test/Makefile.am: add test-scm-query * src/test/.cvsignore: add test-scm-query * src/test/test-scm-query.c: new test -- check query<->scm conversion * src/guile/gnucash.h: new func api * src/guile/gnucash.c.in (gnc_gw_init): new func * src/guile/gnc-helpers.c: fix bugs * src/engine/Query.c: fix bugs git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4928 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 19 +++++++++++++++++++ src/engine/Query.c | 14 ++++++++++---- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 740871ee8a..d70fc3cb3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2001-07-07 Dave Peticolas + + * src/test/gnc-test-stuff.c (get_random_query): not so many terms + + * src/test/Makefile.am: add test-scm-query + + * src/test/.cvsignore: add test-scm-query + + * src/test/test-scm-query.c: new test -- check query<->scm + conversion + + * src/guile/gnucash.h: new func api + + * src/guile/gnucash.c.in (gnc_gw_init): new func + + * src/guile/gnc-helpers.c: fix bugs + + * src/engine/Query.c: fix bugs + 2001-07-06 Dave Peticolas * src/gnome/glade/sched-xact.glade: tweak diff --git a/src/engine/Query.c b/src/engine/Query.c index 6caf6bd1a4..b07701e577 100644 --- a/src/engine/Query.c +++ b/src/engine/Query.c @@ -104,6 +104,12 @@ xaccQueryPrint(Query * q) GList * i, * j; QueryTerm * qt; + if (!q) + { + printf("Query: null\n"); + return; + } + printf("Query: max splits = %d\n", q->max_splits); /* print and & or terms */ @@ -1335,7 +1341,7 @@ xaccQueryTermEqual (QueryTerm *qt1, QueryTerm *qt2) case PD_AMOUNT: if (qt1->data.amount.how != qt2->data.amount.how) return FALSE; if (qt1->data.amount.amt_sgn != qt2->data.amount.amt_sgn) return FALSE; - if (!DEQ (qt1->data.amount.amount, qt2->data.amount.amount)) + if (qt1->data.amount.amount != qt2->data.amount.amount) return FALSE; break; @@ -1968,7 +1974,7 @@ DxaccQueryAddSharePriceMatch(Query * q, double amt, qt->data.base.term_type = PR_PRICE; qt->data.base.sense = 1; qt->data.amount.how = how; - qt->data.amount.amt_sgn = 0; + qt->data.amount.amt_sgn = AMT_SGN_MATCH_EITHER; qt->data.amount.amount = amt; xaccInitQuery(qs, qt); @@ -1988,7 +1994,7 @@ DxaccQueryAddSharePriceMatch(Query * q, double amt, /******************************************************************** * DxaccQueryAddSharesMatch - * Add a share-price filter to an existing query. + * Add a quantity filter to an existing query. * FIXME ?? fix what ?? ********************************************************************/ @@ -2005,7 +2011,7 @@ DxaccQueryAddSharesMatch(Query * q, double amt, qt->data.base.term_type = PR_SHRS; qt->data.base.sense = 1; qt->data.amount.how = how; - qt->data.amount.amt_sgn = 0; + qt->data.amount.amt_sgn = AMT_SGN_MATCH_EITHER; qt->data.amount.amount = amt; xaccInitQuery(qs, qt);