gnucash unstable: Block events while creating scheduled transactions.

John Ralls jralls at code.gnucash.org
Sat Feb 24 16:10:41 EST 2018


Updated	 via  https://github.com/Gnucash/gnucash/commit/d4476d06 (commit)
	from  https://github.com/Gnucash/gnucash/commit/10ab87d9 (commit)



commit d4476d06b4b97a42fd96ea254f8ad5d9af458fc4
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Feb 24 13:02:50 2018 -0800

    Block events while creating scheduled transactions.
    
    Events update the UI, which is slow, and if there are a lot of SXes
    because it's an old file that can be significant.

diff --git a/libgnucash/app-utils/gnc-sx-instance-model.c b/libgnucash/app-utils/gnc-sx-instance-model.c
index 14a54d0..764ada1 100644
--- a/libgnucash/app-utils/gnc-sx-instance-model.c
+++ b/libgnucash/app-utils/gnc-sx-instance-model.c
@@ -1282,10 +1282,14 @@ create_transactions_for_instance(GncSxInstance *instance, GList **created_txn_gu
     creation_data.instance = instance;
     creation_data.created_txn_guids = created_txn_guids;
     creation_data.creation_errors = creation_errors;
-
+    /* Don't update the GUI for every transaction, it can really slow things
+     * down.
+     */
+    qof_event_suspend();
     xaccAccountForEachTransaction(sx_template_account,
                                   create_each_transaction_helper,
                                   &creation_data);
+    qof_event_resume();
 }
 
 void



Summary of changes:
 libgnucash/app-utils/gnc-sx-instance-model.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)



More information about the gnucash-changes mailing list