diff --git a/src/engine/FileIO.c b/src/engine/FileIO.c index 7be7f9ac27..88cbf0f1fa 100644 --- a/src/engine/FileIO.c +++ b/src/engine/FileIO.c @@ -319,7 +319,7 @@ xaccReadAccountGroup( char *datafile ) xaccAccountSetName (acc, LOST_ACC_STR); acc -> children = holder; xaccAccountCommitEdit (acc); - insertAccount (grp, acc); + xaccGroupInsertAccount (grp, acc); } else { xaccFreeAccountGroup (holder); holder = NULL; @@ -412,7 +412,7 @@ readAccount( int fd, AccountGroup *grp, int token ) acc = locateAccount (accID); } else { acc = xaccMallocAccount(); - insertAccount (holder, acc); + xaccGroupInsertAccount (holder, acc); } xaccAccountBeginEdit (acc, 1); @@ -520,7 +520,7 @@ readAccount( int fd, AccountGroup *grp, int token ) } springAccount (acc->id); - insertAccount (grp, acc); + xaccGroupInsertAccount (grp, acc); /* version 4 is the first file version that introduces * sub-accounts */ @@ -576,7 +576,7 @@ locateAccount (int acc_id) acc = xaccMallocAccount (); acc->id = acc_id; acc->open = ACC_DEFER_REBALANCE; - insertAccount (holder, acc); + xaccGroupInsertAccount (holder, acc); /* normalize the account numbers -- positive-definite. * That is, the unique id must never decrease, diff --git a/src/engine/Group.c b/src/engine/Group.c index 41b2f33817..1602006818 100644 --- a/src/engine/Group.c +++ b/src/engine/Group.c @@ -281,34 +281,6 @@ xaccGetPeerAccountFromName ( Account *acc, const char * name ) return peer_acc; } -/********************************************************************\ -\********************************************************************/ -Account * -removeAccount( AccountGroup *grp, int num ) -{ - int i,j, nacc; - Account **arr; - Account *acc = NULL; - - if (!grp) return NULL; - - arr = grp->account; - - grp->saved = FALSE; - - nacc = grp->numAcc; - for( i=0,j=0; inumAcc--; - arr[grp->numAcc] = NULL; - - return acc; -} - /********************************************************************\ \********************************************************************/ @@ -396,14 +368,14 @@ xaccInsertSubAccount( Account *adult, Account *child ) /* allow side-effect of creating a child-less account group */ if (NULL == child) return -1; - retval = insertAccount (adult->children, child); + retval = xaccGroupInsertAccount (adult->children, child); return retval; } /********************************************************************\ \********************************************************************/ int -insertAccount( AccountGroup *grp, Account *acc ) +xaccGroupInsertAccount( AccountGroup *grp, Account *acc ) { int i=-1; Account **oldAcc; @@ -484,7 +456,7 @@ xaccConcatGroups (AccountGroup *togrp, AccountGroup *fromgrp) for (i=0; inumAcc; i++) { acc = fromgrp->account[i]; - insertAccount (togrp, acc); + xaccGroupInsertAccount (togrp, acc); fromgrp->account[i] = NULL; } fromgrp->account[0] = NULL; diff --git a/src/engine/Group.h b/src/engine/Group.h index e94b1c7e7c..3c6289cb91 100644 --- a/src/engine/Group.h +++ b/src/engine/Group.h @@ -57,9 +57,6 @@ void xaccMergeAccounts (AccountGroup *grp); int xaccAccountGroupNotSaved (AccountGroup *grp); void xaccAccountGroupMarkSaved (AccountGroup *grp); -Account *removeAccount( AccountGroup *grp, int num ); -int insertAccount( AccountGroup *grp, Account *acc ); - /* * The xaccRemoveAccount() subroutine will remove the indicated * account from its parent account group. It will NOT free the @@ -77,6 +74,7 @@ int insertAccount( AccountGroup *grp, Account *acc ); */ void xaccRemoveAccount (Account *); void xaccRemoveGroup (AccountGroup *); +int xaccGroupInsertAccount( AccountGroup *grp, Account *acc ); int xaccInsertSubAccount( Account *parent, Account *child ); /* diff --git a/src/engine/QIFIO.c b/src/engine/QIFIO.c index af7f8e8d62..d72d0fb530 100644 --- a/src/engine/QIFIO.c +++ b/src/engine/QIFIO.c @@ -365,10 +365,10 @@ char * xaccReadQIFAccList (int fd, AccountGroup *grp, int cat) xaccInsertSubAccount( parent, acc ); } else { /* we should never get here if the qif file is OK */ - insertAccount( grp, acc ); + xaccGroupInsertAccount( grp, acc ); } } else { - insertAccount( grp, acc ); + xaccGroupInsertAccount( grp, acc ); } } while (qifline); @@ -501,7 +501,7 @@ GetSubQIFAccount (AccountGroup *rootgrp, char *qifline, int acc_type) if (0 > acc_type) acc_type = GuessAccountType (qifline); xaccAccountSetType (xfer_acc, acc_type); - insertAccount (rootgrp, xfer_acc); + xaccGroupInsertAccount (rootgrp, xfer_acc); } /* if this account name had sub-accounts, get those */ @@ -1014,7 +1014,7 @@ xaccReadQIFAccountGroup( char *datafile ) xaccAccountSetType (acc, typo); xaccAccountSetName (acc, name); - insertAccount( grp, acc ); + xaccGroupInsertAccount( grp, acc ); qifline = xaccReadQIFTransList (fd, acc, &bogus_acc_name); typo = -1; name = NULL; continue; @@ -1091,7 +1091,7 @@ xaccReadQIFAccountGroup( char *datafile ) } else { - insertAccount( grp, acc ); + xaccGroupInsertAccount( grp, acc ); } /* spin until start of transaction records */ diff --git a/src/gnome/Add_Dialog.c b/src/gnome/Add_Dialog.c index 523ad76ae5..d59fe706a5 100644 --- a/src/gnome/Add_Dialog.c +++ b/src/gnome/Add_Dialog.c @@ -110,7 +110,7 @@ add_account_dialog_okclicked_cb(GtkWidget * dialog, gpointer data) if (info->parent_account) { g_print( "Return Code (SUB): %d\n", xaccInsertSubAccount (info->parent_account, account)); } else { - g_print( "Return Code (TOPGROUP): %d\n", insertAccount( topgroup, account )); + g_print( "Return Code (TOPGROUP): %d\n", xaccGroupInsertAccount( topgroup, account )); } xaccAccountCommitEdit (account);