From d4476d06b4b97a42fd96ea254f8ad5d9af458fc4 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sat, 24 Feb 2018 13:02:50 -0800 Subject: [PATCH] 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. --- libgnucash/app-utils/gnc-sx-instance-model.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libgnucash/app-utils/gnc-sx-instance-model.c b/libgnucash/app-utils/gnc-sx-instance-model.c index 14a54d0e7d..764ada1189 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