Bug 799370 - Transaction Journal view cursor placement after commit to...

transaction change.

This also reverts commit 60ccca017 and fixes Bug 799347 in a different
way that avoids the problems found during the investigation of 799370
and reported on gnucash-user.
This commit is contained in:
John Ralls 2024-07-15 11:42:29 -07:00
parent d14d11f90a
commit 5fe7a09e7d
4 changed files with 11 additions and 10 deletions

View File

@ -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:
@ -1475,6 +1470,9 @@ gnc_tree_model_account_event_handler (QofInstance *entity,
case QOF_EVENT_MODIFY:
DEBUG("modify account %p (%s)", account, xaccAccountGetName (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)
{

View File

@ -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. */

View File

@ -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;
}

View File

@ -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;