diff --git a/ChangeLog b/ChangeLog index 16eb1cff40..e8dcca81bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-06-05 Dave Peticolas + + * configure.in: changed '! test' to 'test !'. + + * src/engine: removed *Consolidate* functions. These were cruft + used by the old QIFIO routines. + 2000-06-04 Dave Peticolas * src/engine/util.c: add log level modification functions. diff --git a/configure b/configure index b27b8f0561..89b88b4338 100755 --- a/configure +++ b/configure @@ -5813,7 +5813,7 @@ fi if test x"${G_WRAP_COMPILE_ARGS}" = x || \ test x"${G_WRAP_LINK_ARGS}" = x || \ - ! test -x "${G_WRAP}"; + test ! -x "${G_WRAP}"; then { echo "configure: error: @@ -5915,7 +5915,7 @@ fi if test x"${GUILE_COMPILE_ARGS}" = x || \ test x"${GUILE_LINK_ARGS}" = x || \ - ! test -x "${GUILE}"; + test ! -x "${GUILE}"; then { echo "configure: error: diff --git a/configure.in b/configure.in index fb94e3ef2f..3180b06607 100644 --- a/configure.in +++ b/configure.in @@ -394,7 +394,7 @@ AC_PATH_PROG(G_WRAP, g-wrap) if test x"${G_WRAP_COMPILE_ARGS}" = x || \ test x"${G_WRAP_LINK_ARGS}" = x || \ - ! test -x "${G_WRAP}"; + test ! -x "${G_WRAP}"; then AC_MSG_ERROR([ @@ -428,7 +428,7 @@ AC_PATH_PROG(GUILE, guile) if test x"${GUILE_COMPILE_ARGS}" = x || \ test x"${GUILE_LINK_ARGS}" = x || \ - ! test -x "${GUILE}"; + test ! -x "${GUILE}"; then AC_MSG_ERROR([ diff --git a/src/engine/Account.c b/src/engine/Account.c index 5ea491e7f8..99bbefec99 100644 --- a/src/engine/Account.c +++ b/src/engine/Account.c @@ -947,96 +947,6 @@ xaccMoveFarEndByName (Split *split, const char *new_acc_name) /********************************************************************\ \********************************************************************/ -void -xaccConsolidateTransactions (Account * acc) -{ - Split *sa, *sb; - Transaction *ta, *tb; - Timespec ts; - int i,j; - int retval; - - if (!acc) return; - CHECK (acc); - - for (i=0; inumSplits; i++) { - sa = acc->splits[i]; - ta = sa->parent; - for (j=i+1; jnumSplits; j++) { - sb = acc->splits[j]; - tb = sb->parent; - - /* A single transaction can have multiple splits in the same - * account. For instance, a split deposit in AccountA of two - * checks from AccountB creates two splits in AccountB with - * the same parent transaction. Skip this case. - */ - if (ta == tb) continue; - - /* if no match, then continue on in the loop. - * we really must match everything to get a duplicate */ - retval = xaccTransMatch (&ta, &tb); - if (retval) continue; - - /* OK, looks like the two splits are a matching pair. - * Blow one of them, and its entire associated transaction, away. - * (We blow away the transaction because not only do the splits - * match, but so do all of their partner-splits.) - * - * But, before we blow it away, we go through each split and - * update the reconciled flag and date of the split in the - * remaining transaction with those in the one being deleted, - * but only if the remaining transaction has an NREC reconciled - * flag. In other words, the two splits match on everything - * but the reconciled flags and dates, so we assume that the - * one which is not NREC is 'more correct'. This is true in - * the case of importing two QIF files with overlapping - * transactions. Each file will have one 'half' of the - * transaction, but the other half will be generated by the - * QIF importing routines, but with default values for the - * reconciled data. When we load the other file, we need to - * replace the generated 'half' with the real one. - */ - - xaccTransBeginEdit (ta, 1); - - for (i=xaccTransCountSplits(ta); i>0; i--) { - sa = xaccTransGetSplit (ta, i - 1); - - /* If the remaining split is reconciled as something - other than NREC, just leave it alone. */ - if (xaccSplitGetReconcile(sa) != NREC) - continue; - - /* We get the matching split using the ticket value - generated by xaccTransMatch above. */ - sb = xaccTransGetSplit(tb, sa->ticket); - - xaccSplitSetReconcile (sa, xaccSplitGetReconcile(sb)); - xaccSplitGetDateReconciledTS (sb, &ts); - xaccSplitSetDateReconciledTS (sa, &ts); - } - - xaccTransCommitEdit (ta); - - xaccTransBeginEdit (tb, 1); - xaccTransDestroy (tb); - xaccTransCommitEdit (tb); - - - /* It should be safe to just "break" here, as all splits - * with index i or less have been checked already and couldn't - * have been dupes. So index i is still valid, although j is - * not. Note that numSplits changed ... - */ - break; - } - } -} - -/********************************************************************\ -\********************************************************************/ - void xaccAccountSetType (Account *acc, int tip) { diff --git a/src/engine/Account.h b/src/engine/Account.h index ed6bbd610a..ab108abe9a 100644 --- a/src/engine/Account.h +++ b/src/engine/Account.h @@ -115,16 +115,6 @@ int xaccAccountOrder (Account**, Account **); */ void xaccAccountAutoCode (Account *, int digits); -/* The xaccConsolidateTransactions() subroutine scans through - * all of the transactions in an account, and compares them. - * If any of them are exact duplicates, the duplicates are removed. - * duplicates may occur when accounts from multiple sources are - * merged. Note that this can be a dangerous operation to perform, - * as it may remove transactions that were not true duplicatees ... - */ - -void xaccConsolidateTransactions (Account *); - /* The xaccMoveFarEnd() method changes the account to which the * "far end" of the split belongs. The "far end" is as follows: * Double-entry transactions by their nature consist of a set of diff --git a/src/engine/Group.c b/src/engine/Group.c index 74eedee015..18b24e3b72 100644 --- a/src/engine/Group.c +++ b/src/engine/Group.c @@ -893,26 +893,6 @@ xaccMergeAccounts (AccountGroup *grp) /********************************************************************\ \********************************************************************/ -void -xaccConsolidateGrpTransactions (AccountGroup *grp) -{ - Account * acc; - int i; - - if (!grp) return; - - for (i=0; inumAcc; i++) { - acc = grp->account[i]; - xaccConsolidateTransactions (acc); - - /* recursively do the children */ - xaccConsolidateGrpTransactions (acc->children); - } -} - -/********************************************************************\ -\********************************************************************/ - int xaccGroupGetNumAccounts (AccountGroup *grp) { diff --git a/src/engine/Group.h b/src/engine/Group.h index 7c47685697..4a64f930d2 100644 --- a/src/engine/Group.h +++ b/src/engine/Group.h @@ -216,17 +216,6 @@ char * xaccAccountGetNextChildCode (Account *acc, int num_digits); void xaccGroupAutoCode (AccountGroup *grp, int num_digits); void xaccGroupDepthAutoCode (AccountGroup *grp); -/* The xaccConsolidateGrpTrans() subroutine scans through - * all of the transactions in an account, and compares them. - * if any of them are exact duplicates, the duplicates are removed. - * duplicates may occur when accounts from multiple sources are - * merged. Note that this can be a dangerous operation to perform - * - * Note that this subroutine merely walks the account group - * tree, and calls ConsolidateTransacations on each account - */ - -void xaccConsolidateGrpTransactions (AccountGroup *); #ifndef SWIG