gnucash maint: [aqbanking] Bug 797430: Avoid double init of gui

Christian Stimming cstim at code.gnucash.org
Sun Sep 29 15:58:58 EDT 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/82e9b14d (commit)
	from  https://github.com/Gnucash/gnucash/commit/bb4aa19a (commit)



commit 82e9b14dc5fde111821577cce546932fdb1e2418
Author: Christian Stimming <christian at cstimming.de>
Date:   Sun Sep 29 21:58:42 2019 +0200

    [aqbanking] Bug 797430: Avoid double init of gui
    
    Patch by Mike Pieper. Thanks!
    
    Explanation for why this is necessary: The previous (old) behaviour
    changed in 62f7aa66. Before this commit (or when AQBANKING6 is not
    set) it calls AB_JobSepaTransfer_new. For AQBANKING6 it calls
    AB_Transaction_new. AB_Transaction_new is not using gui. Therefore
    gui->state stays on INIT, while before it made several status changes
    (=> RUNNING, FINISHED, HIDDEN). On second call to gnc_GWEN_Gui_get it
    checks the state and finds it still in INIT which seems to be wrong.
    
    So the right fix is to either use gui in AB_Transaction_new or to
    remove first allocation, which is done here.

diff --git a/gnucash/import-export/aqb/gnc-ab-transfer.c b/gnucash/import-export/aqb/gnc-ab-transfer.c
index 928d97cef..153aaab36 100644
--- a/gnucash/import-export/aqb/gnc-ab-transfer.c
+++ b/gnucash/import-export/aqb/gnc-ab-transfer.c
@@ -142,6 +142,7 @@ gnc_ab_maketrans(GtkWidget *parent, Account *gnc_acc,
         GNC_AB_JOB_STATUS job_status;
         GncABImExContextImport *ieci = NULL;
 
+#ifndef AQBANKING6
         /* Get a GUI object */
         gui = gnc_GWEN_Gui_get(parent);
         if (!gui)
@@ -150,6 +151,7 @@ gnc_ab_maketrans(GtkWidget *parent, Account *gnc_acc,
             aborted = TRUE;
             goto repeat;
         }
+#endif
 
         /* Let the user enter the values */
         result = gnc_ab_trans_dialog_run_until_ok(td);



Summary of changes:
 gnucash/import-export/aqb/gnc-ab-transfer.c | 2 ++
 1 file changed, 2 insertions(+)



More information about the gnucash-changes mailing list