gnucash maint: Bug 798044 - Adding splits to a lot is extremely slow

John Ralls jralls at code.gnucash.org
Mon Feb 8 14:48:26 EST 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/a24c350f (commit)
	from  https://github.com/Gnucash/gnucash/commit/702ac394 (commit)



commit a24c350f7940cbbb883390a29da9eed4ceff33d5
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Feb 8 11:47:53 2021 -0800

    Bug 798044 - Adding splits to a lot is extremely slow
    
    Refresh the GUI only once per split.

diff --git a/gnucash/gnome/dialog-lot-viewer.c b/gnucash/gnome/dialog-lot-viewer.c
index e07c5e601..0ebaa42f2 100644
--- a/gnucash/gnome/dialog-lot-viewer.c
+++ b/gnucash/gnome/dialog-lot-viewer.c
@@ -700,9 +700,11 @@ lv_add_split_to_lot_cb (GtkWidget *widget, GNCLotViewer * lv)
     split = lv_get_selected_split(lv, lv->split_free_view);
     if ( NULL == split ) return;
 
+    gnc_suspend_gui_refresh();
     xaccAccountBeginEdit(lv->account);
     gnc_lot_add_split(lv->selected_lot, split);
     xaccAccountCommitEdit(lv->account);
+    gnc_resume_gui_refresh();
 
     lv_refresh(lv);
 }
@@ -719,9 +721,11 @@ lv_remove_split_from_lot_cb (GtkWidget *widget, GNCLotViewer * lv)
     if ( FALSE == lv_can_remove_split_from_lot(split, lv->selected_lot) )
         return;
 
+    gnc_suspend_gui_refresh();
     xaccAccountBeginEdit(lv->account);
     gnc_lot_remove_split(lv->selected_lot, split);
     xaccAccountCommitEdit(lv->account);
+    gnc_resume_gui_refresh();
 
     lv_refresh(lv);
 }



Summary of changes:
 gnucash/gnome/dialog-lot-viewer.c | 4 ++++
 1 file changed, 4 insertions(+)



More information about the gnucash-changes mailing list