From e5788c1ba25391c7d4c41782ebc34cad701484d4 Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Mon, 19 Jun 2000 20:22:54 +0000 Subject: [PATCH] Take out account group guids. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2482 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 7 +++++++ src/engine/GNCId.h | 11 +++++------ src/engine/Group.c | 43 ------------------------------------------- src/engine/Group.h | 11 ----------- src/engine/GroupP.h | 8 -------- 5 files changed, 12 insertions(+), 68 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6808c38fed..85ae8db92f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2000-06-19 Dave Peticolas + * src/guile/gnc.gwp: take out GUIDs for Groups. + + * src/engine/Group.c: take out GUIDs for Groups. Groups are really + just lists with no additional structure, and giving them GUIDs + complicates matters without adding any utility. You can always use + the parent account GUID instead. + * src/gnome/top-level.c: configure list auto-popping from here. * src/register/gnome/combocell-gnome.c: determine whether or not diff --git a/src/engine/GNCId.h b/src/engine/GNCId.h index d85a549c6f..7a03bb2444 100644 --- a/src/engine/GNCId.h +++ b/src/engine/GNCId.h @@ -26,11 +26,11 @@ /* This file defines an API for using gnucash entity identifiers. * - * Identifiers can be used to reference Account Groups, Accounts, - * Transactions, and Splits. These four Gnucash types are referred to - * as Gnucash entities. Identifiers are globally-unique and permanent, - * i.e., once an entity has been assigned an identifier, it retains - * that same identifier for its lifetime. + * Identifiers can be used to reference Accounts, Transactions, and + * Splits. These four Gnucash types are referred to as Gnucash + * entities. Identifiers are globally-unique and permanent, i.e., once + * an entity has been assigned an identifier, it retains that same + * identifier for its lifetime. * * Identifiers can be encoded as hex strings. */ @@ -52,7 +52,6 @@ typedef enum { GNC_ID_NONE = 0, GNC_ID_NULL, - GNC_ID_GROUP, GNC_ID_ACCOUNT, GNC_ID_TRANS, GNC_ID_SPLIT, diff --git a/src/engine/Group.c b/src/engine/Group.c index 18b24e3b72..49c748ba34 100644 --- a/src/engine/Group.c +++ b/src/engine/Group.c @@ -61,9 +61,6 @@ xaccInitializeAccountGroup (AccountGroup *grp) grp->balance = 0.0; - xaccGUIDNew(&grp->guid); - xaccStoreEntity(grp, &grp->guid, GNC_ID_GROUP); - grp->backend = NULL; } @@ -91,8 +88,6 @@ xaccFreeAccountGroup( AccountGroup *grp ) if (NULL == grp) return; - xaccRemoveEntity(&grp->guid); - for( i=0; inumAcc; i++ ) xaccFreeAccount( grp->account[i] ); @@ -153,44 +148,6 @@ xaccGroupNotSaved (AccountGroup *grp) return 0; } -/********************************************************************\ -\********************************************************************/ - -const GUID * -xaccGroupGetGUID (AccountGroup *group) -{ - if (!group) - return xaccGUIDNULL(); - - return &group->guid; -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccGroupSetGUID (AccountGroup *group, GUID *guid) -{ - if (!group || !guid) return; - - xaccRemoveEntity(&group->guid); - - group->guid = *guid; - - xaccStoreEntity(group, &group->guid, GNC_ID_GROUP); -} - -/********************************************************************\ -\********************************************************************/ - -AccountGroup * -xaccGroupLookup (const GUID *guid) -{ - if (!guid) return NULL; - - return xaccLookupEntity(guid, GNC_ID_GROUP); -} - /********************************************************************\ * Get the number of accounts, including subaccounts * \********************************************************************/ diff --git a/src/engine/Group.h b/src/engine/Group.h index 4a64f930d2..bc1b63965f 100644 --- a/src/engine/Group.h +++ b/src/engine/Group.h @@ -36,17 +36,6 @@ AccountGroup *xaccMallocAccountGroup( void ); void xaccFreeAccountGroup( AccountGroup *account_group ); -/* - * The xaccGroupGetGUID() subroutine will return the - * globally unique id associated with that group. - * - * The xaccGroupLookup() subroutine will return the - * group associated with the given id, or NULL - * if there is no such group. - */ -const GUID * xaccGroupGetGUID (AccountGroup *group); -AccountGroup * xaccGroupLookup (const GUID *guid); - /* * The xaccConcatGroups() subroutine will move all accounts * from the "from" group to the "to" group diff --git a/src/engine/GroupP.h b/src/engine/GroupP.h index ac4958ed5d..76923fdce4 100644 --- a/src/engine/GroupP.h +++ b/src/engine/GroupP.h @@ -53,18 +53,10 @@ struct _account_group { int numAcc; /* number of accounts in array */ Account **account; /* array of account pointers */ - GUID guid; /* globally unique id */ - Backend *backend; /* persistant storage backend */ /* cached parameters */ double balance; }; - -/* Set the group's GUID. This should only be done when reading - * a group from a datafile, or some other external source. Never - * call this on an existing group! */ -void xaccGroupSetGUID (AccountGroup *group, GUID *guid); - #endif /* __XACC_ACCOUNT_GROUP_P_H__ */