mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Add ADD/REMOVE events for updating the account tree model.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/branches/gnucash-gnome2-dev@9235 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -652,6 +652,8 @@ xaccGroupRemoveAccount (AccountGroup *grp, Account *acc)
|
||||
return;
|
||||
}
|
||||
|
||||
gnc_engine_generate_event (&acc->guid, GNC_ID_ACCOUNT, GNC_EVENT_REMOVE);
|
||||
|
||||
acc->parent = NULL;
|
||||
|
||||
grp->accounts = g_list_remove (grp->accounts, acc);
|
||||
@@ -757,6 +759,7 @@ xaccGroupInsertAccount (AccountGroup *grp, Account *acc)
|
||||
|
||||
grp->accounts = g_list_insert_sorted (grp->accounts, acc,
|
||||
group_sort_helper);
|
||||
gnc_engine_generate_event (&acc->guid, GNC_ID_ACCOUNT, GNC_EVENT_ADD);
|
||||
|
||||
acc->core_dirty = TRUE;
|
||||
xaccAccountCommitEdit (acc);
|
||||
|
||||
@@ -165,6 +165,8 @@ gnc_engine_generate_event_internal (const GUID *entity, QofIdType type,
|
||||
case GNC_EVENT_CREATE:
|
||||
case GNC_EVENT_MODIFY:
|
||||
case GNC_EVENT_DESTROY:
|
||||
case GNC_EVENT_ADD:
|
||||
case GNC_EVENT_REMOVE:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -35,6 +35,8 @@ typedef enum
|
||||
GNC_EVENT_CREATE = 1 << 0,
|
||||
GNC_EVENT_MODIFY = 1 << 1,
|
||||
GNC_EVENT_DESTROY = 1 << 2,
|
||||
GNC_EVENT_ADD = 1 << 3,
|
||||
GNC_EVENT_REMOVE = 1 << 4,
|
||||
GNC_EVENT_ALL = 0xff
|
||||
} GNCEngineEventType;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user