mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-09-03 20:53:02 -05:00
Fix crash when deleting transaction from reconciliation window.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7155 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -1,3 +1,19 @@
|
||||
2002-08-10 David Hampton <hampton@employees.org>
|
||||
|
||||
* src/engine/Account.c (xaccAccountGetDescendants): New function
|
||||
for consolidating logic.
|
||||
|
||||
* src/gnome/reconcile-list.c (gnc_reconcile_list_new): Use new
|
||||
xaccAccountGetDescendants function.
|
||||
|
||||
* src/gnome/window-reconcile.c (recn_set_watches): Notice changes
|
||||
to all transactions in the reconciliation window, not just those
|
||||
transactions that are in the current account.
|
||||
|
||||
* src/gnome-utils/gnc-mdi-utils.c (gnc_mdi_configure_toolbar_cb):
|
||||
Fix the gnc-mdi window to immediately track the toolbar text/icon
|
||||
setting instead of requiring a restart.
|
||||
|
||||
2002-08-10 Christian Stimming <stimming@tuhh.de>
|
||||
|
||||
* src/import-export/hbci/hbci-interaction.[hc]: Add code for
|
||||
|
||||
@@ -1595,6 +1595,17 @@ xaccAccountGetParentAccount (Account * acc)
|
||||
return xaccGroupGetParentAccount(acc->parent);
|
||||
}
|
||||
|
||||
GList *
|
||||
xaccAccountGetDescendants (Account *acc)
|
||||
{
|
||||
GList *accounts;
|
||||
|
||||
if (!acc) return NULL;
|
||||
accounts = xaccGroupGetSubAccounts(acc->children);
|
||||
accounts = g_list_copy (accounts);
|
||||
return (accounts);
|
||||
}
|
||||
|
||||
GNCAccountType
|
||||
xaccAccountGetType (Account *acc)
|
||||
{
|
||||
|
||||
@@ -289,6 +289,7 @@ void xaccAccountDeleteOldData (Account *account);
|
||||
AccountGroup * xaccAccountGetChildren (Account *account);
|
||||
AccountGroup * xaccAccountGetParent (Account *account);
|
||||
Account * xaccAccountGetParentAccount (Account *account);
|
||||
GList * xaccAccountGetDescendants (Account *account);
|
||||
|
||||
gnc_numeric xaccAccountGetBalance (Account *account);
|
||||
gnc_numeric xaccAccountGetClearedBalance (Account *account);
|
||||
|
||||
@@ -117,7 +117,7 @@ gnc_reconcile_list_new(Account *account, GNCReconcileListType type)
|
||||
{
|
||||
GNCReconcileList *list;
|
||||
gboolean include_children;
|
||||
GList *accounts;
|
||||
GList *accounts = NULL;
|
||||
|
||||
g_return_val_if_fail(account, NULL);
|
||||
g_return_val_if_fail((type == RECLIST_DEBIT) ||
|
||||
@@ -132,19 +132,12 @@ gnc_reconcile_list_new(Account *account, GNCReconcileListType type)
|
||||
|
||||
xaccQuerySetBook(list->query, gnc_get_current_book ());
|
||||
|
||||
/* match the account */
|
||||
accounts = g_list_prepend (NULL, account);
|
||||
|
||||
include_children = xaccAccountGetReconcileChildrenStatus(account);
|
||||
if (include_children)
|
||||
{
|
||||
AccountGroup *account_group = xaccAccountGetChildren(account);
|
||||
GList *children = xaccGroupGetSubAccounts(account_group);
|
||||
accounts = xaccAccountGetDescendants(account);
|
||||
|
||||
children = g_list_copy (children);
|
||||
|
||||
accounts = g_list_concat (accounts, children);
|
||||
}
|
||||
/* match the account */
|
||||
accounts = g_list_prepend (accounts, account);
|
||||
|
||||
xaccQueryAddAccountMatch (list->query, accounts, GUID_MATCH_ANY, QUERY_AND);
|
||||
|
||||
|
||||
@@ -1507,19 +1507,12 @@ find_by_account (gpointer find_data, gpointer user_data)
|
||||
}
|
||||
|
||||
static void
|
||||
recn_set_watches (RecnWindow *recnData)
|
||||
recn_set_watches_one_account (gpointer data, gpointer user_data)
|
||||
{
|
||||
Account *account;
|
||||
Account *account = (Account *)data;
|
||||
RecnWindow *recnData = (RecnWindow *)user_data;
|
||||
GList *node;
|
||||
|
||||
gnc_gui_component_clear_watches (recnData->component_id);
|
||||
|
||||
gnc_gui_component_watch_entity (recnData->component_id,
|
||||
&recnData->account,
|
||||
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
|
||||
|
||||
account = recn_get_account (recnData);
|
||||
|
||||
for (node = xaccAccountGetSplitList (account); node; node = node->next)
|
||||
{
|
||||
Split *split = node->data;
|
||||
@@ -1544,6 +1537,33 @@ recn_set_watches (RecnWindow *recnData)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
recn_set_watches (RecnWindow *recnData)
|
||||
{
|
||||
gboolean include_children;
|
||||
Account *account;
|
||||
GList *accounts = NULL;
|
||||
|
||||
gnc_gui_component_clear_watches (recnData->component_id);
|
||||
|
||||
gnc_gui_component_watch_entity (recnData->component_id,
|
||||
&recnData->account,
|
||||
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
|
||||
|
||||
account = recn_get_account (recnData);
|
||||
|
||||
include_children = xaccAccountGetReconcileChildrenStatus(account);
|
||||
if (include_children)
|
||||
accounts = xaccAccountGetDescendants(account);
|
||||
|
||||
/* match the account */
|
||||
accounts = g_list_prepend (accounts, account);
|
||||
|
||||
g_list_foreach(accounts, recn_set_watches_one_account, recnData);
|
||||
|
||||
g_list_free (accounts);
|
||||
}
|
||||
|
||||
static void
|
||||
refresh_handler (GHashTable *changes, gpointer user_data)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user