r14713 - gnucash/branches/remove-group - Don't require the root account to have a commodity.
David Hampton
hampton at cvs.gnucash.org
Tue Aug 22 17:51:37 EDT 2006
Author: hampton
Date: 2006-08-22 17:51:36 -0400 (Tue, 22 Aug 2006)
New Revision: 14713
Trac: http://svn.gnucash.org/trac/changeset/14713
Modified:
gnucash/branches/remove-group/ChangeLog
gnucash/branches/remove-group/src/backend/file/gnc-account-xml-v2.c
gnucash/branches/remove-group/src/backend/file/io-gncxml-v2.c
gnucash/branches/remove-group/src/engine/Account.c
gnucash/branches/remove-group/src/engine/Account.h
gnucash/branches/remove-group/src/engine/Scrub.c
Log:
Don't require the root account to have a commodity.
Modified: gnucash/branches/remove-group/ChangeLog
===================================================================
--- gnucash/branches/remove-group/ChangeLog 2006-08-22 20:08:08 UTC (rev 14712)
+++ gnucash/branches/remove-group/ChangeLog 2006-08-22 21:51:36 UTC (rev 14713)
@@ -1,3 +1,11 @@
+2006-08-22 David Hampton <hampton at employees.org>
+
+ * src/backend/file/gnc-account-xml-v2.c:
+ * src/backend/file/io-gncxml-v2.c:
+ * src/engine/Account.[ch]:
+ * src/engine/Scrub.c: Don't require the root account to have a
+ commodity.
+
2006-08-21 David Hampton <hampton at employees.org>
* src/engine/Account.[ch]:
Modified: gnucash/branches/remove-group/src/backend/file/gnc-account-xml-v2.c
===================================================================
--- gnucash/branches/remove-group/src/backend/file/gnc-account-xml-v2.c 2006-08-22 20:08:08 UTC (rev 14712)
+++ gnucash/branches/remove-group/src/backend/file/gnc-account-xml-v2.c 2006-08-22 21:51:36 UTC (rev 14713)
@@ -483,8 +483,7 @@
if (type != ACCT_TYPE_ROOT) {
root = gnc_book_get_root_account(book);
if (root == NULL) {
- gnc_commodity *com = xaccAccountGetCommodity(acc);
- root = gnc_account_create_root(book, com);
+ root = gnc_account_create_root(book);
}
gnc_account_append_child(root, acc);
}
Modified: gnucash/branches/remove-group/src/backend/file/io-gncxml-v2.c
===================================================================
--- gnucash/branches/remove-group/src/backend/file/io-gncxml-v2.c 2006-08-22 20:08:08 UTC (rev 14712)
+++ gnucash/branches/remove-group/src/backend/file/io-gncxml-v2.c 2006-08-22 21:51:36 UTC (rev 14713)
@@ -191,8 +191,7 @@
if (parent == NULL) {
root = gnc_book_get_root_account(data->book);
if (root == NULL) {
- gnc_commodity *com = xaccAccountGetCommodity(act);
- root = gnc_account_create_root(data->book, com);
+ root = gnc_account_create_root(data->book);
/* Leave the account in the edit state. It will be committed
* at the end of reading all the transactions. */
xaccAccountBeginEdit(root);
Modified: gnucash/branches/remove-group/src/engine/Account.c
===================================================================
--- gnucash/branches/remove-group/src/engine/Account.c 2006-08-22 20:08:08 UTC (rev 14712)
+++ gnucash/branches/remove-group/src/engine/Account.c 2006-08-22 21:51:36 UTC (rev 14713)
@@ -219,15 +219,13 @@
}
Account *
-gnc_account_create_root (QofBook *book, gnc_commodity *com)
+gnc_account_create_root (QofBook *book)
{
Account *root;
root = xaccMallocAccount(book);
xaccAccountBeginEdit(root);
root->type = ACCT_TYPE_ROOT;
- root->commodity = com;
- root->commodity_scu = gnc_commodity_get_fraction(com);
xaccAccountCommitEdit(root);
gnc_book_set_root_account(book, root);
return root;
Modified: gnucash/branches/remove-group/src/engine/Account.h
===================================================================
--- gnucash/branches/remove-group/src/engine/Account.h 2006-08-22 20:08:08 UTC (rev 14712)
+++ gnucash/branches/remove-group/src/engine/Account.h 2006-08-22 21:51:36 UTC (rev 14713)
@@ -148,7 +148,7 @@
Account * xaccMallocAccount (QofBook *book);
/** Create a new root level account. */
-Account * gnc_account_create_root (QofBook *book, gnc_commodity *com);
+Account * gnc_account_create_root (QofBook *book);
/** The xaccCloneAccount() does the same as xaccCloneAccountSimple(),
* except that it also also places a pair of GUID-pointers
Modified: gnucash/branches/remove-group/src/engine/Scrub.c
===================================================================
--- gnucash/branches/remove-group/src/engine/Scrub.c 2006-08-22 20:08:08 UTC (rev 14712)
+++ gnucash/branches/remove-group/src/engine/Scrub.c 2006-08-22 21:51:36 UTC (rev 14713)
@@ -666,6 +666,7 @@
gnc_commodity *commodity;
if (!account) return;
+ if (xaccAccountGetType(account) == ACCT_TYPE_ROOT) return;
commodity = xaccAccountGetCommodity (account);
if (commodity) return;
More information about the gnucash-changes
mailing list