Skip to content

Commit

Permalink
Bug 799370 - Transaction Journal view cursor placement after commit t…
Browse files Browse the repository at this point in the history
…o...

transaction change.

This also reverts commit 60ccca0 and fixes Bug 799347 in a different
way that avoids the problems found during the investigation of 799370
and reported on gnucash-user.
  • Loading branch information
jralls committed Jul 15, 2024
1 parent d14d11f commit 5fe7a09
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
10 changes: 4 additions & 6 deletions gnucash/gnome-utils/gnc-tree-model-account.c
Original file line number Diff line number Diff line change
Expand Up @@ -1429,11 +1429,6 @@ gnc_tree_model_account_event_handler (QofInstance *entity,
return;
}

/* clear the cached model values for account */
if (event_type != QOF_EVENT_ADD)
gnc_tree_model_account_clear_cached_values (model, account);

/* What to do, that to do. */
switch (event_type)
{
case QOF_EVENT_ADD:
Expand Down Expand Up @@ -1475,7 +1470,10 @@ gnc_tree_model_account_event_handler (QofInstance *entity,

case QOF_EVENT_MODIFY:
DEBUG("modify account %p (%s)", account, xaccAccountGetName (account));
path = gnc_tree_model_account_get_path_from_account (model, account);
/* clear the cached model values for account */
gnc_tree_model_account_clear_cached_values(model, account);

path = gnc_tree_model_account_get_path_from_account(model, account);
if (!path)
{
DEBUG("can't generate path");
Expand Down
3 changes: 3 additions & 0 deletions gnucash/gnome/gnc-plugin-page-account-tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1510,6 +1510,9 @@ gnc_plugin_page_account_tree_cmd_delete_account (GSimpleAction *simple,
if (account == NULL)
return;

if (!gnc_main_window_all_finish_pending())
return;

memset (&adopt, 0, sizeof (adopt));
/* If the account has objects referring to it, show the list - the account can't be deleted until these
references are dealt with. */
Expand Down
2 changes: 2 additions & 0 deletions gnucash/register/register-gnome/combocell-gnome.c
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,8 @@ gnc_combo_cell_gui_move (BasicCell* bcell)
gnc_item_edit_set_popup (box->item_edit, NULL, NULL,
NULL, NULL, NULL, NULL, NULL);

gnc_item_list_select (box->item_list, NULL);

box->list_popped = FALSE;
}

Expand Down
6 changes: 2 additions & 4 deletions libgnucash/engine/Account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2871,13 +2871,11 @@ gnc_account_remove_child (Account *parent, Account *child)
ed.node = parent;
ed.idx = gnc_account_child_index (parent, child);

// First send the event before we invalidate everything in children.
qof_event_gen(&child->inst, QOF_EVENT_REMOVE, &ed);

// Then remove the child and release its memory.
ppriv->children.erase (std::remove (ppriv->children.begin(), ppriv->children.end(), child),
ppriv->children.end());

/* Now send the event. */
qof_event_gen(&child->inst, QOF_EVENT_REMOVE, &ed);

/* clear the account's parent pointer after REMOVE event generation. */
cpriv->parent = nullptr;
Expand Down

1 comment on commit 5fe7a09

@agwekixj
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit appears to break the automatic "Present" balance refresh on the "Accounts" tab. To reproduce, reset the date an existing transaction in a register in or out of the range.

Please sign in to comment.