From a74bb32ac530290573187e82df52ac10b53695f4 Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Wed, 10 May 2000 05:37:04 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2288 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 4 ++++ Makefile.in | 2 ++ src/engine/Group.c | 4 ++-- src/gnome/dialog-add.c | 14 ++++++++------ 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6410c82183..2ff7ba5766 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2000-05-09 Dave Peticolas + * src/gnome/dialog-add.c (gnc_ui_accWindow_create_account): insert + the account *after* setting the account values so the sort order + is correct. + * src/engine/Account.c (xaccAccountInsertSplit): check the currency before inserting. diff --git a/Makefile.in b/Makefile.in index 294f489da3..ffa475d3a0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -41,6 +41,8 @@ default: @echo "qt kde/qt version (unfinished)" @echo "qt-static kde/qt statically linked version (unfinished)" @echo " " + @echo "The motif and qt versions do not compile!" + @echo " " # This inclusion must come after the first target, and after the # definitions of *_SRCS, etc., but before the usage of *_OBJS. diff --git a/src/engine/Group.c b/src/engine/Group.c index 5dd3c57008..c8a0c24a6c 100644 --- a/src/engine/Group.c +++ b/src/engine/Group.c @@ -551,7 +551,7 @@ xaccGroupInsertAccount( AccountGroup *grp, Account *acc ) int i,nacc; Account **arr; int ralo = 1; - + if (NULL == grp) return; if (NULL == acc) return; @@ -566,7 +566,7 @@ xaccGroupInsertAccount( AccountGroup *grp, Account *acc ) } grp->saved = GNC_F; - /* set back-pointer to the accounts parent */ + /* set back-pointer to the account's parent */ acc->parent = grp; nacc = grp->numAcc; diff --git a/src/gnome/dialog-add.c b/src/gnome/dialog-add.c index e7c63b4aff..75ef0a3622 100644 --- a/src/gnome/dialog-add.c +++ b/src/gnome/dialog-add.c @@ -343,19 +343,15 @@ static void gnc_ui_accWindow_create_account(Account * account, Account * parent, gint type, AccountFieldStrings * strings) { + xaccAccountBeginEdit(parent, 0); xaccAccountBeginEdit(account, 0); - if (parent != NULL) - xaccInsertSubAccount (parent, account); - else - xaccGroupInsertAccount(gncGetCurrentGroup(), account); - xaccAccountSetType (account, type); gnc_ui_install_field_strings(account, strings, TRUE); { /* make a default transaction */ - Transaction *trans = xaccMallocTransaction(); + Transaction *trans = xaccMallocTransaction(); xaccTransBeginEdit(trans, 1); xaccTransSetDateToday (trans); @@ -365,7 +361,13 @@ gnc_ui_accWindow_create_account(Account * account, Account * parent, xaccAccountInsertSplit (account, xaccTransGetSplit (trans, 0) ); } + if (parent != NULL) + xaccInsertSubAccount (parent, account); + else + xaccGroupInsertAccount(gncGetCurrentGroup(), account); + xaccAccountCommitEdit (account); + xaccAccountCommitEdit (parent); gnc_account_tree_insert_account(gnc_get_current_account_tree(), account);