[Gnucash-changes] r13435 - gnucash/trunk - Move the storage for the
account separator character into Account.c
David Hampton
hampton at cvs.gnucash.org
Thu Mar 2 02:20:37 EST 2006
Author: hampton
Date: 2006-03-02 02:20:33 -0500 (Thu, 02 Mar 2006)
New Revision: 13435
Trac: http://svn.gnucash.org/trac/changeset/13435
Modified:
gnucash/trunk/ChangeLog
gnucash/trunk/src/app-utils/gnc-account-merge.c
gnucash/trunk/src/app-utils/gnc-ui-util.c
gnucash/trunk/src/app-utils/gnc-ui-util.h
gnucash/trunk/src/business/business-core/gncTaxTable.c
gnucash/trunk/src/business/business-gnome/business-gnome-utils.c
gnucash/trunk/src/business/business-gnome/dialog-invoice.c
gnucash/trunk/src/business/business-gnome/dialog-payment.c
gnucash/trunk/src/business/business-ledger/gncEntryLedger.c
gnucash/trunk/src/business/business-ledger/gncEntryLedgerLoad.c
gnucash/trunk/src/business/business-ledger/gncEntryLedgerModel.c
gnucash/trunk/src/business/dialog-tax-table/dialog-tax-table.c
gnucash/trunk/src/engine/Account.c
gnucash/trunk/src/engine/Account.h
gnucash/trunk/src/engine/Group.c
gnucash/trunk/src/engine/Group.h
gnucash/trunk/src/engine/Split.c
gnucash/trunk/src/engine/Split.h
gnucash/trunk/src/engine/Transaction.c
gnucash/trunk/src/engine/Transaction.h
gnucash/trunk/src/engine/gw-engine-spec.scm
gnucash/trunk/src/gnome-utils/account-quickfill.c
gnucash/trunk/src/gnome-utils/dialog-account.c
gnucash/trunk/src/gnome-utils/dialog-transfer.c
gnucash/trunk/src/gnome-utils/gnc-account-sel.c
gnucash/trunk/src/gnome-utils/gnc-tree-view-account.c
gnucash/trunk/src/gnome/druid-hierarchy.c
gnucash/trunk/src/gnome/druid-stock-split.c
gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c
gnucash/trunk/src/gnome/gnc-plugin-page-register.c
gnucash/trunk/src/gnome/top-level.c
gnucash/trunk/src/gnome/window-reconcile.c
gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c
gnucash/trunk/src/import-export/import-main-matcher.c
gnucash/trunk/src/import-export/import-match-map.c
gnucash/trunk/src/import-export/qif-import/qif-merge-groups.scm
gnucash/trunk/src/import-export/qif-import/qif-to-gnc.scm
gnucash/trunk/src/register/ledger-core/split-register-control.c
gnucash/trunk/src/register/ledger-core/split-register-load.c
gnucash/trunk/src/register/ledger-core/split-register-model.c
gnucash/trunk/src/register/ledger-core/split-register.c
gnucash/trunk/src/report/report-system/report-utilities.scm
Log:
Move the storage for the account separator character into Account.c
(default ':') and set it with an accessor function at startup and when
it is changed in the preferences/gconf. Eliminate unnecessary passing
around of the account separator character.
Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/ChangeLog 2006-03-02 07:20:33 UTC (rev 13435)
@@ -1,3 +1,11 @@
+2006-03-02 David Hampton <hampton at employees.org>
+
+ * numerous: Move the storage for the account separator character
+ into Account.c (default ':') and set it with an accessor function
+ at startup and when it is changed in the preferences/gconf.
+ Eliminate unnecessary passing around of the account separator
+ character.
+
2006-03-01 David Hampton <hampton at employees.org>
* src/register/register-core/pricecell.c:
Modified: gnucash/trunk/src/app-utils/gnc-account-merge.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-account-merge.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/app-utils/gnc-account-merge.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -18,12 +18,11 @@
GncAccountMergeDisposition
determine_merge_disposition(AccountGroup *existing_root, Account *new_acct)
{
- const char sep_char = '.';
Account *existing_acct;
gchar *full_name;
- full_name = xaccAccountGetFullName(new_acct, sep_char);
- existing_acct = xaccGetAccountFromFullName(existing_root, full_name, sep_char);
+ full_name = xaccAccountGetFullName(new_acct);
+ existing_acct = xaccGetAccountFromFullName(existing_root, full_name);
g_free(full_name);
return determine_account_merge_disposition(existing_acct, new_acct);
Modified: gnucash/trunk/src/app-utils/gnc-ui-util.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-ui-util.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/app-utils/gnc-ui-util.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -50,6 +50,7 @@
#define KEY_CURRENCY_CHOICE "currency_choice"
#define KEY_CURRENCY_OTHER "currency_other"
+#define KEY_REVERSED_ACCOUNTS "reversed_accounts"
static QofLogModule log_module = GNC_MOD_GUI;
@@ -66,8 +67,8 @@
* Args: none *
* Returns: account separator character *
\*******************************************************************/
-char
-gnc_get_account_separator (void)
+static void
+gnc_configure_account_separator (void)
{
char separator = ':';
char *string;
@@ -88,7 +89,7 @@
if (string != NULL)
free(string);
- return separator;
+ gnc_set_account_separator(separator);
}
@@ -101,7 +102,7 @@
for (i = 0; i < NUM_ACCOUNT_TYPES; i++)
reverse_type[i] = FALSE;
- choice = gnc_gconf_get_string(GCONF_GENERAL, "reversed_accounts", NULL);
+ choice = gnc_gconf_get_string(GCONF_GENERAL, KEY_REVERSED_ACCOUNTS, NULL);
if (safe_strcmp (choice, "none") == 0)
{
@@ -706,7 +707,7 @@
{
if (!account) return NULL;
- return xaccAccountGetFullName (account, gnc_get_account_separator ());
+ return xaccAccountGetFullName (account);
}
static void
@@ -2042,7 +2043,11 @@
void
gnc_ui_util_init (void)
{
- gnc_gconf_general_register_cb("reversed_accounts",
+ gnc_configure_account_separator ();
+ gnc_gconf_general_register_cb(KEY_ACCOUNT_SEPARATOR,
+ (GncGconfGeneralCb)gnc_configure_account_separator,
+ NULL);
+ gnc_gconf_general_register_cb(KEY_REVERSED_ACCOUNTS,
(GncGconfGeneralCb)gnc_configure_reverse_balance,
NULL);
gnc_gconf_general_register_cb("auto_decimal_point",
Modified: gnucash/trunk/src/app-utils/gnc-ui-util.h
===================================================================
--- gnucash/trunk/src/app-utils/gnc-ui-util.h 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/app-utils/gnc-ui-util.h 2006-03-02 07:20:33 UTC (rev 13435)
@@ -45,12 +45,6 @@
typedef QofSession * (*QofSessionCB) (void);
-/** Returns the account separation character chosen by the user.
- *
- * @return The character to use.
- */
-char gnc_get_account_separator (void);
-
gboolean gnc_reverse_balance(const Account *account);
gboolean gnc_reverse_balance_type(GNCAccountType type);
Modified: gnucash/trunk/src/business/business-core/gncTaxTable.c
===================================================================
--- gnucash/trunk/src/business/business-core/gncTaxTable.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/business/business-core/gncTaxTable.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -663,9 +663,8 @@
if (!a) return -1;
if (!b) return 1;
- name_a = xaccAccountGetFullName (a->account, ':');
- name_b = xaccAccountGetFullName (b->account, ':');
- /* for comparison purposes it doesn't matter what we use as a separator */
+ name_a = xaccAccountGetFullName (a->account);
+ name_b = xaccAccountGetFullName (b->account);
retval = safe_strcmp(name_a, name_b);
g_free(name_a);
g_free(name_b);
Modified: gnucash/trunk/src/business/business-gnome/business-gnome-utils.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/business-gnome-utils.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/business/business-gnome/business-gnome-utils.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -327,7 +327,7 @@
== -1)
continue;
- name = xaccAccountGetFullName (account, gnc_get_account_separator ());
+ name = xaccAccountGetFullName (account);
if (name != NULL) {
names = g_list_append (names, name);
if (!safe_strcmp (name, text))
Modified: gnucash/trunk/src/business/business-gnome/dialog-invoice.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/dialog-invoice.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/business/business-gnome/dialog-invoice.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -1455,7 +1455,7 @@
ts = gncInvoiceGetDatePosted (invoice);
gnc_date_edit_set_time_ts (GNC_DATE_EDIT (iw->posted_date), ts);
- tmp_string = xaccAccountGetFullName (acct, gnc_get_account_separator ());
+ tmp_string = xaccAccountGetFullName (acct);
gtk_entry_set_text (GTK_ENTRY (acct_entry), tmp_string);
g_free(tmp_string);
Modified: gnucash/trunk/src/business/business-gnome/dialog-payment.c
===================================================================
--- gnucash/trunk/src/business/business-gnome/dialog-payment.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/business/business-gnome/dialog-payment.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -253,8 +253,7 @@
return;
}
- post = xaccGetAccountFromFullName (gnc_book_get_group (pw->book),
- text, gnc_get_account_separator ());
+ post = xaccGetAccountFromFullName (gnc_book_get_group (pw->book), text);
if (!post) {
char *msg = g_strdup_printf (
Modified: gnucash/trunk/src/business/business-ledger/gncEntryLedger.c
===================================================================
--- gnucash/trunk/src/business/business-ledger/gncEntryLedger.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/business/business-ledger/gncEntryLedger.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -88,8 +88,7 @@
Account *account;
/* Find the account */
- account = xaccGetAccountFromFullName (gnc_get_current_group (),
- name, gnc_get_account_separator ());
+ account = xaccGetAccountFromFullName (gnc_get_current_group (), name);
if (!account) {
/* Ask if they want to create a new one. */
@@ -106,7 +105,7 @@
*new = TRUE;
/* Now have a new account. Update the cell with the name as created. */
- fullname = xaccAccountGetFullName (account, gnc_get_account_separator ());
+ fullname = xaccAccountGetFullName (account);
gnc_combo_cell_set_value (cell, fullname);
gnc_basic_cell_set_changed (&cell->cell, TRUE);
g_free (fullname);
Modified: gnucash/trunk/src/business/business-ledger/gncEntryLedgerLoad.c
===================================================================
--- gnucash/trunk/src/business/business-ledger/gncEntryLedgerLoad.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/business/business-ledger/gncEntryLedgerLoad.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -219,7 +219,7 @@
if (xaccAccountGetPlaceholder (account)) return NULL;
- name = xaccAccountGetFullName (account, gnc_get_account_separator ());
+ name = xaccAccountGetFullName (account);
if (NULL == name) return NULL;
gnc_combo_cell_add_menu_item (bce->cell, name);
g_free(name);
Modified: gnucash/trunk/src/business/business-ledger/gncEntryLedgerModel.c
===================================================================
--- gnucash/trunk/src/business/business-ledger/gncEntryLedgerModel.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/business/business-ledger/gncEntryLedgerModel.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -157,8 +157,7 @@
entry = gnc_entry_ledger_get_entry (ledger, virt_loc.vcell_loc);
g_free (name);
- name = xaccAccountGetFullName (gncEntryGetInvAccount (entry),
- gnc_get_account_separator ());
+ name = xaccAccountGetFullName (gncEntryGetInvAccount (entry));
return name;
}
@@ -175,8 +174,7 @@
entry = gnc_entry_ledger_get_entry (ledger, virt_loc.vcell_loc);
g_free (name);
- name = xaccAccountGetFullName (gncEntryGetBillAccount (entry),
- gnc_get_account_separator ());
+ name = xaccAccountGetFullName (gncEntryGetBillAccount (entry));
return name;
}
Modified: gnucash/trunk/src/business/dialog-tax-table/dialog-tax-table.c
===================================================================
--- gnucash/trunk/src/business/dialog-tax-table/dialog-tax-table.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/business/dialog-tax-table/dialog-tax-table.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -365,7 +365,7 @@
Account *acc = gncTaxTableEntryGetAccount (entry);
gnc_numeric amount = gncTaxTableEntryGetAmount (entry);
- row_text[0] = xaccAccountGetFullName (acc, gnc_get_account_separator ());
+ row_text[0] = xaccAccountGetFullName (acc);
switch (gncTaxTableEntryGetType (entry)) {
case GNC_AMT_TYPE_PERCENT:
row_text[1] =
Modified: gnucash/trunk/src/engine/Account.c
===================================================================
--- gnucash/trunk/src/engine/Account.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/engine/Account.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -40,6 +40,9 @@
static QofLogModule log_module = GNC_MOD_ACCOUNT;
+/* The Canonical Account Separator. Pre-Initialized. */
+static char account_separator = ':';
+
/********************************************************************\
* Because I can't use C++ for this project, doesn't mean that I *
* can't pretend to! These functions perform actions on the *
@@ -49,7 +52,27 @@
static void xaccAccountBringUpToDate (Account *acc);
+
/********************************************************************\
+ * gnc_get_account_separator *
+ * returns the current account separator character *
+ * *
+ * Args: none *
+ * Returns: account separator character *
+ \*******************************************************************/
+char
+gnc_get_account_separator (void)
+{
+ return account_separator;
+}
+
+void
+gnc_set_account_separator (char separator)
+{
+ account_separator = separator;
+}
+
+/********************************************************************\
\********************************************************************/
G_INLINE_FUNC void mark_account (Account *acc);
@@ -1408,7 +1431,7 @@
}
char *
-xaccAccountGetFullName(const Account *account, const char separator)
+xaccAccountGetFullName(const Account *account)
{
const Account *a;
char *fullname;
@@ -1456,7 +1479,7 @@
/* if we're not at the root, add another separator */
if (a != NULL)
- *p-- = separator;
+ *p-- = account_separator;
}
return fullname;
Modified: gnucash/trunk/src/engine/Account.h
===================================================================
--- gnucash/trunk/src/engine/Account.h 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/engine/Account.h 2006-03-02 07:20:33 UTC (rev 13435)
@@ -179,6 +179,13 @@
/** @name Account lookup and GUID routines
@{ */
+/** Returns the account separation character chosen by the user.
+ *
+ * @return The character to use.
+ */
+char gnc_get_account_separator (void);
+void gnc_set_account_separator (char separator);
+
/** @deprecated */
#define xaccAccountGetBook(X) qof_instance_get_book(QOF_INSTANCE(X))
#define xaccAccountGetGUID(X) qof_entity_get_guid(QOF_ENTITY(X))
@@ -236,7 +243,7 @@
* hack alert -- since it breaks the rule of string allocation, maybe this
* routine should not be in this library, but some utility library?
*/
-char * xaccAccountGetFullName (const Account *account, const char separator);
+char * xaccAccountGetFullName (const Account *account);
/** Set a string that identifies the Finance::Quote backend that
* should be used to retrieve online prices. See price-quotes.scm
Modified: gnucash/trunk/src/engine/Group.c
===================================================================
--- gnucash/trunk/src/engine/Group.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/engine/Group.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -500,12 +500,12 @@
Account *
xaccGetAccountFromFullName (const AccountGroup *grp,
- const char *name,
- const char separator)
+ const char *name)
{
GList *node;
Account *found;
char *p;
+ char separator;
if (!grp) return NULL;
if (!name) return NULL;
@@ -513,6 +513,8 @@
p = (char *) name;
found = NULL;
+ separator = gnc_get_account_separator();
+
while (1)
{
/* Look for the first separator. */
@@ -539,8 +541,7 @@
/* There's stuff left to search for.
* Search recursively after the separator. */
- found = xaccGetAccountFromFullName(account->children,
- p + 1, separator);
+ found = xaccGetAccountFromFullName(account->children, p + 1);
/* If we found the account, break out. */
if (found != NULL)
@@ -599,8 +600,7 @@
\********************************************************************/
Account *
-xaccGetPeerAccountFromFullName (const Account *acc, const char * name,
- const char separator)
+xaccGetPeerAccountFromFullName (const Account *acc, const char * name)
{
AccountGroup * root;
Account *peer_acc;
@@ -612,7 +612,7 @@
root = xaccAccountGetRoot (acc);
/* now search all acounts hanging off the root */
- peer_acc = xaccGetAccountFromFullName (root, name, separator);
+ peer_acc = xaccGetAccountFromFullName (root, name);
return peer_acc;
}
Modified: gnucash/trunk/src/engine/Group.h
===================================================================
--- gnucash/trunk/src/engine/Group.h 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/engine/Group.h 2006-03-02 07:20:33 UTC (rev 13435)
@@ -236,8 +236,7 @@
* using the given separator.
*/
Account *xaccGetAccountFromFullName (const AccountGroup *group,
- const char *name,
- const char separator);
+ const char *name);
/** The xaccGetPeerAccountFromName() subroutine fetches the
* account by name from the collection of accounts
@@ -251,8 +250,7 @@
* names using the given separator.
*/
Account *xaccGetPeerAccountFromFullName (const Account *acc,
- const char * name,
- const char separator);
+ const char * name);
/** @} */
Modified: gnucash/trunk/src/engine/Split.c
===================================================================
--- gnucash/trunk/src/engine/Split.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/engine/Split.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -1118,7 +1118,7 @@
}
char *
-xaccSplitGetCorrAccountFullName(const Split *sa, char separator)
+xaccSplitGetCorrAccountFullName(const Split *sa)
{
static const char *split_const = NULL;
const Split *other_split;
@@ -1130,7 +1130,7 @@
return g_strdup(split_const);
}
- return xaccAccountGetFullName(other_split->acc, separator);
+ return xaccAccountGetFullName(other_split->acc);
}
const char *
@@ -1162,9 +1162,8 @@
aa = sa->acc;
ab = sb->acc;
- full_a = xaccAccountGetFullName(aa, ':');
- full_b = xaccAccountGetFullName(ab, ':');
- /* for comparison purposes it doesn't matter what we use as a separator */
+ full_a = xaccAccountGetFullName(aa);
+ full_b = xaccAccountGetFullName(ab);
retval = safe_strcmp(full_a, full_b);
g_free(full_a);
g_free(full_b);
@@ -1199,8 +1198,8 @@
* as long as they are the same
*/
- ca = xaccSplitGetCorrAccountFullName(sa, ':');
- cb = xaccSplitGetCorrAccountFullName(sb, ':');
+ ca = xaccSplitGetCorrAccountFullName(sa);
+ cb = xaccSplitGetCorrAccountFullName(sb);
retval = safe_strcmp(ca, cb);
g_free(ca);
g_free(cb);
Modified: gnucash/trunk/src/engine/Split.h
===================================================================
--- gnucash/trunk/src/engine/Split.h 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/engine/Split.h 2006-03-02 07:20:33 UTC (rev 13435)
@@ -396,7 +396,7 @@
* is silly.
*/
-char * xaccSplitGetCorrAccountFullName(const Split *sa, char seperator);
+char * xaccSplitGetCorrAccountFullName(const Split *sa);
/** document me */
const char * xaccSplitGetCorrAccountName(const Split *sa);
/** document me */
Modified: gnucash/trunk/src/engine/Transaction.c
===================================================================
--- gnucash/trunk/src/engine/Transaction.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/engine/Transaction.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -1722,14 +1722,13 @@
\********************************************************************/
Account *
-xaccGetAccountByFullName (const Transaction *trans, const char * name,
- const char separator)
+xaccGetAccountByFullName (const Transaction *trans, const char * name)
{
Account *acc;
if (!trans || !name) return NULL;
acc = get_any_account(trans);
- return acc ? xaccGetPeerAccountFromFullName (acc, name, separator) : NULL;
+ return acc ? xaccGetPeerAccountFromFullName (acc, name) : NULL;
}
/********************************************************************\
Modified: gnucash/trunk/src/engine/Transaction.h
===================================================================
--- gnucash/trunk/src/engine/Transaction.h 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/engine/Transaction.h 2006-03-02 07:20:33 UTC (rev 13435)
@@ -442,8 +442,7 @@
/** The xaccGetAccountByFullName routine is similar to xaccGetAccountByName, but uses
* full names using the given separator.*/
Account * xaccGetAccountByFullName (const Transaction *trans,
- const char *name,
- const char separator);
+ const char *name);
/** @name Transaction voiding
Modified: gnucash/trunk/src/engine/gw-engine-spec.scm
===================================================================
--- gnucash/trunk/src/engine/gw-engine-spec.scm 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/engine/gw-engine-spec.scm 2006-03-02 07:20:33 UTC (rev 13435)
@@ -452,7 +452,7 @@
'gnc:split-get-corr-account-full-name-internal
'(<gw:gchars> caller-owned)
"xaccSplitGetCorrAccountFullName"
- '((<gnc:Split*> sa) (<gw:char> separator))
+ '((<gnc:Split*> sa))
"Find the split on the other side of the transaction, and return the
name of its account. Don't use directly, use
gnc:split-get-corr-account-full-name in src/scm/report-utilities.scm")
@@ -1065,8 +1065,7 @@
'<gnc:Account*>
"xaccGetAccountFromFullName"
'((<gnc:AccountGroup*> g)
- ((<gw:mchars> caller-owned const) name)
- (<gw:char> separator))
+ ((<gw:mchars> caller-owned const) name))
"Return account named name in group g. full path with separators.")
(gw:wrap-function
Modified: gnucash/trunk/src/gnome/druid-hierarchy.c
===================================================================
--- gnucash/trunk/src/gnome/druid-hierarchy.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/gnome/druid-hierarchy.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -664,12 +664,11 @@
{
case GNC_ACCOUNT_MERGE_DISPOSITION_USE_EXISTING: {
/* find the existing account, do whatever it is. */
- const char sep_char = '.';
gchar *full_name;
Account *existing_acct;
AccountGroup *root_group = gnc_book_get_group(gnc_get_current_book());
- full_name = xaccAccountGetFullName(account, sep_char);
- existing_acct = xaccGetAccountFromFullName(root_group, full_name, sep_char);
+ full_name = xaccAccountGetFullName(account);
+ existing_acct = xaccGetAccountFromFullName(root_group, full_name);
willbe_placeholder = xaccAccountGetPlaceholder(existing_acct);
g_free(full_name);
} break;
Modified: gnucash/trunk/src/gnome/druid-stock-split.c
===================================================================
--- gnucash/trunk/src/gnome/druid-stock-split.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/gnome/druid-stock-split.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -147,8 +147,7 @@
print_info = gnc_account_print_info (account, FALSE);
- strings[0] = xaccAccountGetFullName (account,
- gnc_get_account_separator ());
+ strings[0] = xaccAccountGetFullName (account);
strings[1] = (char *) gnc_commodity_get_mnemonic (commodity);
strings[2] = (char *) xaccPrintAmount (balance, print_info);
strings[3] = NULL;
Modified: gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-account-tree.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -874,7 +874,7 @@
return;
window = gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page));
- acct_name = xaccAccountGetFullName(account, gnc_get_account_separator ());
+ acct_name = xaccAccountGetFullName(account);
if (!acct_name) {
acct_name = g_strdup (_("(no name)"));
}
@@ -999,7 +999,7 @@
lines[0] = g_strdup_printf(format, acct_name);
if (splits) {
if (ta) {
- name = xaccAccountGetFullName(ta, gnc_get_account_separator ());
+ name = xaccAccountGetFullName(ta);
format = _("All transactions in this account will be moved to "
"the account %s.");
lines[++i] = g_strdup_printf(format, name);
@@ -1010,7 +1010,7 @@
}
if (children) {
if (daa) {
- name = xaccAccountGetFullName(daa, gnc_get_account_separator ());
+ name = xaccAccountGetFullName(daa);
format = _("All of its sub-accounts will be moved to "
"the account %s.");
lines[++i] = g_strdup_printf(format, name);
@@ -1018,7 +1018,7 @@
format = _("All of its subaccounts will be deleted.");
lines[++i] = g_strdup_printf("%s", format);
if (dta) {
- name = xaccAccountGetFullName(ta, gnc_get_account_separator ());
+ name = xaccAccountGetFullName(ta);
format = _("All sub-account transactions will be moved to "
"the account %s.");
lines[++i] = g_strdup_printf(format, name);
Modified: gnucash/trunk/src/gnome/gnc-plugin-page-register.c
===================================================================
--- gnucash/trunk/src/gnome/gnc-plugin-page-register.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/gnome/gnc-plugin-page-register.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -847,8 +847,7 @@
leader = gnc_ledger_display_leader(priv->ledger);
g_key_file_set_string(key_file, group_name, KEY_REGISTER_TYPE, label);
g_key_file_set_string(key_file, group_name, KEY_ACCOUNT_NAME,
- xaccAccountGetFullName(leader,
- gnc_get_account_separator()));
+ xaccAccountGetFullName(leader));
} else if (reg->type == GENERAL_LEDGER) {
g_key_file_set_string(key_file, group_name, KEY_REGISTER_TYPE,
LABEL_GL);
@@ -962,8 +961,7 @@
KEY_ACCOUNT_NAME, &error);
book = qof_session_get_book(gnc_get_current_session());
account = xaccGetAccountFromFullName(xaccGetAccountGroup(book),
- acct_name,
- gnc_get_account_separator());
+ acct_name);
g_free(acct_name);
if (account == NULL) {
LEAVE("Bad account name");
@@ -1610,8 +1608,7 @@
if ((leader != NULL) && (ledger_type != LD_GL))
{
- account_name = xaccAccountGetFullName (leader,
- gnc_get_account_separator ());
+ account_name = xaccAccountGetFullName (leader);
if (ledger_type == LD_SINGLE)
{
Modified: gnucash/trunk/src/gnome/top-level.c
===================================================================
--- gnucash/trunk/src/gnome/top-level.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/gnome/top-level.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -119,8 +119,7 @@
if (strncmp("account=", location, 8) == 0)
{
account = xaccGetAccountFromFullName (gnc_get_current_group (),
- location + 8,
- gnc_get_account_separator ());
+ location + 8);
}
/* href="gnc-register:guid=12345678901234567890123456789012" */
Modified: gnucash/trunk/src/gnome/window-reconcile.c
===================================================================
--- gnucash/trunk/src/gnome/window-reconcile.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/gnome/window-reconcile.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -385,7 +385,7 @@
char *fullname;
char *title;
- fullname = xaccAccountGetFullName(account, gnc_get_account_separator());
+ fullname = xaccAccountGetFullName(account);
title = g_strconcat(fullname, " - ", text && *text ? _(text) : "", NULL);
g_free(fullname);
@@ -1090,7 +1090,7 @@
char *fullname;
char *title;
- fullname = xaccAccountGetFullName(account, gnc_get_account_separator());
+ fullname = xaccAccountGetFullName(account);
title = g_strconcat(fullname, " - ", _("Reconcile"), NULL);
g_free(fullname);
Modified: gnucash/trunk/src/gnome-utils/account-quickfill.c
===================================================================
--- gnucash/trunk/src/gnome-utils/account-quickfill.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/gnome-utils/account-quickfill.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -93,7 +93,7 @@
if (skip) return;
}
- name = xaccAccountGetFullName (account, gnc_get_account_separator ());
+ name = xaccAccountGetFullName (account);
if (NULL == name) return;
match = gnc_quickfill_get_string_match (qf, name);
@@ -125,7 +125,7 @@
if (skip) return NULL;
}
- name = xaccAccountGetFullName (account, gnc_get_account_separator ());
+ name = xaccAccountGetFullName (account);
if (NULL == name) return NULL;
gnc_quickfill_insert (qfb->qf, name, QUICKFILL_ALPHA);
g_free(name);
Modified: gnucash/trunk/src/gnome-utils/dialog-account.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-account.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/gnome-utils/dialog-account.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -552,7 +552,7 @@
if (fs == NULL) return;
if (fs->account == account) return;
- full_name = xaccAccountGetFullName(account, gnc_get_account_separator());
+ full_name = xaccAccountGetFullName(account);
if(!full_name)
full_name = g_strdup("");
@@ -744,15 +744,15 @@
parent = gnc_tree_view_account_get_selected_account
(GNC_TREE_VIEW_ACCOUNT (aw->parent_tree));
if (parent == NULL) {
- account = xaccGetAccountFromFullName(group, name, separator);
+ account = xaccGetAccountFromFullName(group, name);
} else {
sep_string[0] = separator;
sep_string[1] = '\0';
- fullname_parent = xaccAccountGetFullName(parent, separator);
+ fullname_parent = xaccAccountGetFullName(parent);
fullname = g_strconcat(fullname_parent, sep_string, name, NULL);
- account = xaccGetAccountFromFullName(group, fullname, separator);
+ account = xaccGetAccountFromFullName(group, fullname);
g_free(fullname_parent);
g_free(fullname);
@@ -1349,8 +1349,7 @@
char *parent_name;
char sep_string[2];
- parent_name = xaccAccountGetFullName (parent_account,
- gnc_get_account_separator());
+ parent_name = xaccAccountGetFullName (parent_account);
sep_string[0] = gnc_get_account_separator ();
sep_string[1] = '\0';
@@ -1561,7 +1560,7 @@
Account *account;
char *p;
- account = xaccGetAccountFromFullName (group, name, separator);
+ account = xaccGetAccountFromFullName (group, name);
if (account)
{
*base_account = account;
Modified: gnucash/trunk/src/gnome-utils/dialog-transfer.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-transfer.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/gnome-utils/dialog-transfer.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -1384,11 +1384,9 @@
char *name;
if (xaccAccountGetPlaceholder(from_account))
- name = xaccAccountGetFullName(from_account,
- gnc_get_account_separator ());
+ name = xaccAccountGetFullName(from_account);
else
- name = xaccAccountGetFullName(to_account,
- gnc_get_account_separator ());
+ name = xaccAccountGetFullName(to_account);
gnc_error_dialog(xferData->dialog, placeholder_format, name);
g_free(name);
LEAVE("placeholder");
Modified: gnucash/trunk/src/gnome-utils/gnc-account-sel.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-account-sel.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/gnome-utils/gnc-account-sel.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -165,7 +165,6 @@
typedef struct {
GNCAccountSel *gas;
GList **outList;
- char accountSep;
} accounts_to_names_data;
/**
@@ -203,7 +202,6 @@
nameList = NULL;
atnd.gas = gas;
atnd.outList = &nameList;
- atnd.accountSep = gnc_get_account_separator();
g_list_foreach( accts, gas_accounts_to_names,
(gpointer)&atnd );
@@ -266,8 +264,7 @@
}
}
*atnd->outList =
- g_list_append( *atnd->outList,
- xaccAccountGetFullName(a, atnd->accountSep) );
+ g_list_append( *atnd->outList, xaccAccountGetFullName(a) );
}
#if 0 /* completion not implemented */
@@ -378,8 +375,7 @@
gtk_list_select_item( GTK_LIST(gas->combo->list), 0 );
return;
}
- acctStr = xaccAccountGetFullName( acct,
- gnc_get_account_separator() );
+ acctStr = xaccAccountGetFullName( acct );
gtk_entry_set_text( GTK_ENTRY(gas->combo->entry), acctStr );
g_free( acctStr );
}
@@ -398,7 +394,7 @@
goto cleanup;
}
ag = gnc_book_get_group( gnc_get_current_book() );
- ret = xaccGetAccountFromFullName( ag, txt, gnc_get_account_separator() );
+ ret = xaccGetAccountFromFullName( ag, txt );
cleanup:
g_free( txt );
return ret;
Modified: gnucash/trunk/src/gnome-utils/gnc-tree-view-account.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-view-account.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-view-account.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -1746,8 +1746,7 @@
if (account == NULL)
return;
- account_name = xaccAccountGetFullName(account,
- gnc_get_account_separator());
+ account_name = xaccAccountGetFullName(account);
if (account_name == NULL)
return;
@@ -1780,8 +1779,7 @@
if (account == NULL)
return;
- account_name = xaccAccountGetFullName (account,
- gnc_get_account_separator ());
+ account_name = xaccAccountGetFullName (account);
if (account_name == NULL)
return;
@@ -1836,8 +1834,7 @@
book = qof_session_get_book(gnc_get_current_session());
account = xaccGetAccountFromFullName(xaccGetAccountGroup(book),
- account_name,
- gnc_get_account_separator());
+ account_name);
if (account)
gnc_tree_view_account_expand_to_account(view, account);
}
@@ -1859,8 +1856,7 @@
book = qof_session_get_book(gnc_get_current_session());
account = xaccGetAccountFromFullName(xaccGetAccountGroup(book),
- account_name,
- gnc_get_account_separator());
+ account_name);
if (account)
gnc_tree_view_account_set_selected_account(view, account);
}
Modified: gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -177,8 +177,7 @@
if (gacc == NULL)
row_text[1] = "";
else
- row_text[1] =
- xaccAccountGetFullName (gacc, gnc_get_account_separator ());
+ row_text[1] = xaccAccountGetFullName (gacc);
/* Add this row to the list */
row = gtk_clist_append (GTK_CLIST (info->accountlist), row_text);
Modified: gnucash/trunk/src/import-export/import-main-matcher.c
===================================================================
--- gnucash/trunk/src/import-export/import-main-matcher.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/import-export/import-main-matcher.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -667,8 +667,7 @@
gtk_clist_set_background (GTK_CLIST (gui->clist), row_number,
&(gui->color_back_green));
tmp = xaccAccountGetFullName
- (gnc_import_TransInfo_get_destacc (info),
- gnc_get_account_separator ());
+ (gnc_import_TransInfo_get_destacc (info));
if(gnc_import_TransInfo_get_destacc_selected_manually(info)
== TRUE)
{
Modified: gnucash/trunk/src/import-export/import-match-map.c
===================================================================
--- gnucash/trunk/src/import-export/import-match-map.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/import-export/import-match-map.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -442,8 +442,7 @@
PINFO("found match");
LEAVE(" ");
return xaccGetAccountFromFullName(gnc_book_get_group(imap->book),
- account_i.account_name,
- gnc_get_account_separator());
+ account_i.account_name);
}
PINFO("no match");
@@ -471,7 +470,7 @@
return;
}
- account_fullname = xaccAccountGetFullName(acc, gnc_get_account_separator());
+ account_fullname = xaccAccountGetFullName(acc);
PINFO("account name: '%s'\n", account_fullname);
Modified: gnucash/trunk/src/import-export/qif-import/qif-merge-groups.scm
===================================================================
--- gnucash/trunk/src/import-export/qif-import/qif-merge-groups.scm 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/import-export/qif-import/qif-merge-groups.scm 2006-03-02 07:20:33 UTC (rev 13435)
@@ -35,7 +35,6 @@
;; trying to find matches in the new group. If there are matches,
;; push the matches onto a list.
(let* ((new-xtns (gnc:group-get-transactions new-group))
- (separator (string-ref (gnc:account-separator-char) 0))
(progress-dialog #f)
(work-to-do (length new-xtns))
(work-done 0)
@@ -90,7 +89,7 @@
sq
(gnc:get-account-from-full-name
old-group (gnc:account-get-full-name
- (gnc:split-get-account split)) separator)
+ (gnc:split-get-account split)))
'query-and)
;; we want the value for the split to match the value
Modified: gnucash/trunk/src/import-export/qif-import/qif-to-gnc.scm
===================================================================
--- gnucash/trunk/src/import-export/qif-import/qif-to-gnc.scm 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/import-export/qif-import/qif-to-gnc.scm 2006-03-02 07:20:33 UTC (rev 13435)
@@ -19,7 +19,7 @@
(gnc-name (qif-map-entry:gnc-name acct-info))
(existing-account (hash-ref gnc-acct-hash gnc-name))
(same-gnc-account
- (gnc:get-account-from-full-name old-group gnc-name separator))
+ (gnc:get-account-from-full-name old-group gnc-name))
(allowed-types
(qif-map-entry:allowed-types acct-info))
(make-new-acct #f)
@@ -38,13 +38,12 @@
#t))))
(define (make-unique-name-variant long-name short-name)
- (if (gnc:get-account-from-full-name old-group long-name separator)
+ (if (gnc:get-account-from-full-name old-group long-name)
(let loop ((count 2))
(let* ((test-name
(string-append long-name (sprintf #f " %a" count)))
(test-acct
- (gnc:get-account-from-full-name old-group test-name
- separator)))
+ (gnc:get-account-from-full-name old-group test-name)))
(if (and test-acct (not (compatible? test-acct)))
(loop (+ 1 count))
(string-append short-name (sprintf #f " %a" count)))))
Modified: gnucash/trunk/src/register/ledger-core/split-register-control.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register-control.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/register/ledger-core/split-register-control.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -831,8 +831,7 @@
/* auto-complete the account name */
cell = gnc_table_layout_get_cell (reg->table->layout, XFRM_CELL);
- fullname = xaccAccountGetFullName (xaccSplitGetAccount (auto_split),
- gnc_get_account_separator ());
+ fullname = xaccAccountGetFullName (xaccSplitGetAccount (auto_split));
gnc_combo_cell_set_value ((ComboCell *) cell, fullname);
g_free(fullname);
Modified: gnucash/trunk/src/register/ledger-core/split-register-load.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register-load.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/register/ledger-core/split-register-load.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -573,7 +573,7 @@
if (xaccAccountGetPlaceholder (account)) return NULL;
- name = xaccAccountGetFullName (account, gnc_get_account_separator ());
+ name = xaccAccountGetFullName (account);
if (NULL == name) return NULL;
gnc_combo_cell_add_account_menu_item (cell, name);
g_free(name);
Modified: gnucash/trunk/src/register/ledger-core/split-register-model.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register-model.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/register/ledger-core/split-register-model.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -84,9 +84,7 @@
const char *name;
name = gnc_table_layout_get_cell_value (reg->table->layout, XFRM_CELL);
- account = xaccGetAccountFromFullName (gnc_get_current_group (),
- name,
- gnc_get_account_separator ());
+ account = xaccGetAccountFromFullName (gnc_get_current_group (), name);
}
if (!account)
@@ -1221,8 +1219,7 @@
g_free (name);
- name = xaccAccountGetFullName (xaccSplitGetAccount (split),
- gnc_get_account_separator ());
+ name = xaccAccountGetFullName (xaccSplitGetAccount (split));
return name;
}
@@ -1263,8 +1260,7 @@
g_free (name);
if (s)
- name = xaccAccountGetFullName (xaccSplitGetAccount (s),
- gnc_get_account_separator ());
+ name = xaccAccountGetFullName (xaccSplitGetAccount (s));
else
{
/* For multi-split transactions and stock splits,
@@ -1808,7 +1804,7 @@
account = xaccAccountLookup (guid, gnc_get_current_book ());
- name = xaccAccountGetFullName (account, gnc_get_account_separator ());
+ name = xaccAccountGetFullName (account);
}
else
name = NULL;
Modified: gnucash/trunk/src/register/ledger-core/split-register.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register.c 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/register/ledger-core/split-register.c 2006-03-02 07:20:33 UTC (rev 13435)
@@ -1551,8 +1551,7 @@
return NULL;
/* Find the account */
- account = xaccGetAccountFromFullName (gnc_get_current_group (),
- name, gnc_get_account_separator ());
+ account = xaccGetAccountFromFullName (gnc_get_current_group (), name);
if (!account) {
/* Ask if they want to create a new one. */
@@ -1568,7 +1567,7 @@
*refresh = TRUE;
/* Now have a new account. Update the cell with the name as created. */
- fullname = xaccAccountGetFullName (account, gnc_get_account_separator ());
+ fullname = xaccAccountGetFullName (account);
gnc_combo_cell_set_value (cell, fullname);
gnc_basic_cell_set_changed (&cell->cell, TRUE);
g_free (fullname);
Modified: gnucash/trunk/src/report/report-system/report-utilities.scm
===================================================================
--- gnucash/trunk/src/report/report-system/report-utilities.scm 2006-03-02 00:24:54 UTC (rev 13434)
+++ gnucash/trunk/src/report/report-system/report-utilities.scm 2006-03-02 07:20:33 UTC (rev 13435)
@@ -155,8 +155,7 @@
(gnc:group-get-account-list (gnc:get-current-group))))
(define (gnc:split-get-corr-account-full-name split)
- (let ((separator (string-ref (gnc:account-separator-char) 0)))
- (gnc:split-get-corr-account-full-name-internal split separator)))
+ (gnc:split-get-corr-account-full-name-internal split))
;; get children that are the direct descendant of this acct
More information about the gnucash-changes
mailing list