r21208 - gnucash/trunk/src - [Decruftification] Combine xaccCloneAccountSimple and
John Ralls
jralls at code.gnucash.org
Mon Aug 22 14:19:04 EDT 2011
Author: jralls
Date: 2011-08-22 14:19:03 -0400 (Mon, 22 Aug 2011)
New Revision: 21208
Trac: http://svn.gnucash.org/trac/changeset/21208
Modified:
gnucash/trunk/src/engine/Account.c
gnucash/trunk/src/engine/Account.h
gnucash/trunk/src/gnome/assistant-hierarchy.c
Log:
[Decruftification] Combine xaccCloneAccountSimple and
xaccCloneAccountCommon into a single xaccCloneAccount
Since removing the qofinstance-gemini xaccCloneAccount means that the
only user of xaccCloneAccountCommon is xaccCloneAccountSimple, which
adds only one line beyond calling xaccCloneAccountCommon, combine them
into a single function, called xaccCloneAccount (no need to make it
simple since it's the only one.)
Modified: gnucash/trunk/src/engine/Account.c
===================================================================
--- gnucash/trunk/src/engine/Account.c 2011-08-22 18:18:53 UTC (rev 21207)
+++ gnucash/trunk/src/engine/Account.c 2011-08-22 18:19:03 UTC (rev 21208)
@@ -987,8 +987,8 @@
return root;
}
-static Account *
-xaccCloneAccountCommon(const Account *from, QofBook *book)
+Account *
+xaccCloneAccount(const Account *from, QofBook *book)
{
Account *ret;
AccountPrivate *from_priv, *priv;
@@ -1024,18 +1024,11 @@
priv->commodity_scu = from_priv->commodity_scu;
priv->non_standard_scu = from_priv->non_standard_scu;
+ qof_instance_set_dirty(&ret->inst);
LEAVE (" ");
return ret;
}
-Account *
-xaccCloneAccountSimple (const Account *from, QofBook *book)
-{
- Account *ret = xaccCloneAccountCommon(from, book);
- qof_instance_set_dirty(&ret->inst);
- return ret;
-}
-
/********************************************************************\
\********************************************************************/
Modified: gnucash/trunk/src/engine/Account.h
===================================================================
--- gnucash/trunk/src/engine/Account.h 2011-08-22 18:18:53 UTC (rev 21207)
+++ gnucash/trunk/src/engine/Account.h 2011-08-22 18:19:03 UTC (rev 21208)
@@ -177,7 +177,7 @@
/** Create a new root level account. */
Account * gnc_account_create_root (QofBook *book);
-/** The xaccCloneAccountSimple() routine makes a simple copy of the
+/** The xaccCloneAccount() routine makes a simple copy of the
* indicated account, placing it in the indicated book. It copies
* the account type, name, description, and the kvp values;
* it does not copy splits/transactions. The book should have
@@ -185,7 +185,7 @@
* unique name as the ones being copied in the account (the
* commodities in the clone will be those from the book).
*/
-Account * xaccCloneAccountSimple (const Account *source, QofBook *book);
+Account * xaccCloneAccount (const Account *source, QofBook *book);
/** The xaccAccountBeginEdit() subroutine is the first phase of
* a two-phase-commit wrapper for account updates. */
Modified: gnucash/trunk/src/gnome/assistant-hierarchy.c
===================================================================
--- gnucash/trunk/src/gnome/assistant-hierarchy.c 2011-08-22 18:18:53 UTC (rev 21207)
+++ gnucash/trunk/src/gnome/assistant-hierarchy.c 2011-08-22 18:19:03 UTC (rev 21208)
@@ -582,7 +582,7 @@
{
Account *ret;
- ret = xaccCloneAccountSimple (from, gnc_get_current_book ());
+ ret = xaccCloneAccount (from, gnc_get_current_book ());
xaccAccountSetCommodity (ret, com);
More information about the gnucash-changes
mailing list