gnucash maint: [aqbanking] Keep transaction purpose conversion

Christian Stimming cstim at code.gnucash.org
Sun Sep 15 16:16:43 EDT 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/50e59077 (commit)
	from  https://github.com/Gnucash/gnucash/commit/ec5b1109 (commit)



commit 50e59077d7160ba2d9eb1cb587c3b0c5597fee31
Author: Christian Stimming <christian at cstimming.de>
Date:   Sun Sep 15 22:15:58 2019 +0200

    [aqbanking] Keep transaction purpose conversion
    
    With the newest (beta) aqbanking versions there is a renamed
    version of the previous getter of the txn purpose available, which
    had been switched to a different semantic in between.

diff --git a/gnucash/import-export/aqb/gnc-ab-utils.c b/gnucash/import-export/aqb/gnc-ab-utils.c
index 89510918b..addad8003 100644
--- a/gnucash/import-export/aqb/gnc-ab-utils.c
+++ b/gnucash/import-export/aqb/gnc-ab-utils.c
@@ -379,10 +379,11 @@ gchar *
 gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans, gboolean is_ofx)
 {
 #ifdef AQBANKING6
-    const char* ab_purpose;
-#else
-    const GWEN_STRINGLIST *ab_purpose;
+#  if AQBANKING_VERSION_INT < 59929
+#    error "You are using an old beta version of aqbanking > 5.99.0 but < 5.99.29, please upgrade to the latest 5.99.29 or newer."
+#  endif
 #endif
+    const GWEN_STRINGLIST *ab_purpose;
     const char *ab_transactionText = NULL;
     gchar *gnc_description = NULL;
 
@@ -398,17 +399,20 @@ gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans, gboolean is_ofx)
             gnc_description = g_strdup(ab_transactionText);
     }
 
-    ab_purpose = AB_Transaction_GetPurpose(ab_trans);
+    ab_purpose =
 #ifdef AQBANKING6
-    gnc_description = g_strdup(ab_purpose ? ab_purpose : "");
+            /* With aqbanking-5.99.29, the identical function as before is now available under this new name. */
+            AB_Transaction_GetPurposeAsStringList
 #else
+            AB_Transaction_GetPurpose
+#endif
+            (ab_trans);
     if (ab_purpose)
         GWEN_StringList_ForEach(ab_purpose, join_ab_strings_cb,
                                 &gnc_description);
 
     if (!gnc_description)
         gnc_description = g_strdup("");
-#endif
 
     return gnc_description;
 }



Summary of changes:
 gnucash/import-export/aqb/gnc-ab-utils.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)



More information about the gnucash-changes mailing list