gnucash maint: Multiple changes pushed

Robert Fewell bobit at code.gnucash.org
Fri Jul 29 06:46:12 EDT 2022


Updated	 via  https://github.com/Gnucash/gnucash/commit/09e5c46d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/dea1a89e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/6cad1d16 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/edf000f4 (commit)
	from  https://github.com/Gnucash/gnucash/commit/ebf34395 (commit)



commit 09e5c46dfda0b53e89ceba4167ceb1c3b78931c4
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Fri Jul 29 11:28:55 2022 +0100

    Remove some default 'dummy' store entries as not required.

diff --git a/gnucash/gnome/dialog-report-style-sheet.c b/gnucash/gnome/dialog-report-style-sheet.c
index bf6fe65a0..a4f8d7527 100644
--- a/gnucash/gnome/dialog-report-style-sheet.c
+++ b/gnucash/gnome/dialog-report-style-sheet.c
@@ -230,9 +230,7 @@ gnc_style_sheet_new (StyleSheetDialog * ssd)
 
     g_assert (ssd);
 
-    /* Erase the initial dummy entry. */
     template_model = gtk_combo_box_get_model (GTK_COMBO_BOX(template_combo));
-    gtk_list_store_clear (GTK_LIST_STORE(template_model));
 
     /* put in the list of style sheet type names */
     for (; !scm_is_null (templates); templates = SCM_CDR(templates))
diff --git a/gnucash/gtkbuilder/assistant-qif-import.glade b/gnucash/gtkbuilder/assistant-qif-import.glade
index 033b8075d..68012c759 100644
--- a/gnucash/gtkbuilder/assistant-qif-import.glade
+++ b/gnucash/gtkbuilder/assistant-qif-import.glade
@@ -2,27 +2,11 @@
 <!-- Generated with glade 3.38.2 -->
 <interface>
   <requires lib="gtk+" version="3.22"/>
-  <object class="GtkListStore" id="currency_liststore">
-    <columns>
-      <!-- column-name item -->
-      <column type="gchararray"/>
-    </columns>
-    <data>
-      <row>
-        <col id="0" translatable="yes">Dummy</col>
-      </row>
-    </data>
-  </object>
   <object class="GtkListStore" id="date_format_liststore">
     <columns>
       <!-- column-name item -->
       <column type="gchararray"/>
     </columns>
-    <data>
-      <row>
-        <col id="0" translatable="yes">Dummy</col>
-      </row>
-    </data>
   </object>
   <object class="GtkAssistant" id="qif_import_assistant">
     <property name="can-focus">False</property>
diff --git a/gnucash/gtkbuilder/dialog-report.glade b/gnucash/gtkbuilder/dialog-report.glade
index 27957c699..ab8b3b095 100644
--- a/gnucash/gtkbuilder/dialog-report.glade
+++ b/gnucash/gtkbuilder/dialog-report.glade
@@ -697,11 +697,6 @@
       <!-- column-name item -->
       <column type="gchararray"/>
     </columns>
-    <data>
-      <row>
-        <col id="0" translatable="yes">Dummy</col>
-      </row>
-    </data>
   </object>
   <object class="GtkDialog" id="new_style_sheet_dialog">
     <property name="can-focus">False</property>
diff --git a/gnucash/import-export/qif-imp/assistant-qif-import.c b/gnucash/import-export/qif-imp/assistant-qif-import.c
index 008060162..fb1347fd0 100644
--- a/gnucash/import-export/qif-imp/assistant-qif-import.c
+++ b/gnucash/import-export/qif-imp/assistant-qif-import.c
@@ -3805,7 +3805,6 @@ gnc_ui_qif_import_assistant_make (QIFImportWindow *qif_win)
     GtkWidget         *box;
 
     builder = gtk_builder_new ();
-    gnc_builder_add_from_file (builder, "assistant-qif-import.glade", "currency_liststore");
     gnc_builder_add_from_file (builder, "assistant-qif-import.glade", "date_format_liststore");
     gnc_builder_add_from_file (builder, "assistant-qif-import.glade", "qif_import_assistant");
 

commit dea1a89e81853ddd6a38963e8a535bb95a9bb91e
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Fri Jul 29 10:55:44 2022 +0100

    Bug 798573 - Tab Width Behaviour
    
    Currently when the notebook tabs on the left or right, the space used
    fluctuates depending on tab label width. This change sets the label
    width to the preference setting when the tabs are on the left or right
    but when top or bottom the width is set to the number of characters
    when shorter than the preference setting so they take up less room.

diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c
index 30e124926..165a3393d 100644
--- a/gnucash/gnome-utils/gnc-main-window.c
+++ b/gnucash/gnome-utils/gnc-main-window.c
@@ -2162,9 +2162,39 @@ gnc_main_window_update_tab_color (gpointer gsettings, gchar *pref, gpointer user
 }
 
 
-/** Set the tab label ellipsize value. The special check for a zero
- *  value handles the case where a user hasn't set a tab width and
- *  the preference default isn't detected.
+/** This data structure allows the passing of the tab width and
+ *  whether the tab layout is on the left or right.
+ */
+typedef struct
+{
+    gint tab_width;
+    gboolean tabs_left_right;
+} TabWidth;
+
+static TabWidth *
+populate_tab_width_struct (void)
+{
+    TabWidth *tw;
+
+    tw = g_new0 (TabWidth, 1);
+    tw->tab_width = gnc_prefs_get_float (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_WIDTH);
+    tw->tabs_left_right = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_POSITION_LEFT) ||
+                          gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_POSITION_RIGHT);
+
+    return tw;
+}
+
+/** Set the tab label ellipsize value.
+ *  When the tabs are on the left or right, the label width is set to
+ *  the tab_width value. Doing this maintains a steady notepad header
+ *  width for the tabs.
+ *
+ *  When the tabs are on the top or bottom, the label width is set to
+ *  the number of characters when shorter than tab_width so they take
+ *  up less room.
+ *
+ *  The special check for a zero value handles the case where a user
+ *  hasn't set a tab width and the preference default isn't detected.
  *
  *  @internal
  *
@@ -2172,9 +2202,11 @@ gnc_main_window_update_tab_color (gpointer gsettings, gchar *pref, gpointer user
  *
  *  @param tab_width Tab width the user has set in preferences.
  *
+ *  @param tab_left_right Whether the tab layout is on the left or right.
+ *
  */
 static void
-gnc_main_window_set_tab_ellipsize (GtkWidget *label, gint tab_width)
+gnc_main_window_set_tab_ellipsize (GtkWidget *label, gint tab_width, gboolean tab_left_right)
 {
     const gchar *lab_text = gtk_label_get_text (GTK_LABEL(label));
 
@@ -2183,7 +2215,11 @@ gnc_main_window_set_tab_ellipsize (GtkWidget *label, gint tab_width)
         gint text_length = g_utf8_strlen (lab_text, -1);
         if (text_length < tab_width)
         {
-            gtk_label_set_width_chars (GTK_LABEL(label), text_length);
+            if (tab_left_right) // tabs position is left or right
+                gtk_label_set_width_chars (GTK_LABEL(label), tab_width);
+            else // tabs position is top or bottom
+                gtk_label_set_width_chars (GTK_LABEL(label), text_length);
+
             gtk_label_set_ellipsize (GTK_LABEL(label), PANGO_ELLIPSIZE_NONE);
         }
         else
@@ -2212,19 +2248,21 @@ gnc_main_window_set_tab_ellipsize (GtkWidget *label, gint tab_width)
  */
 static void
 gnc_main_window_update_tab_width_one_page (GncPluginPage *page,
-        gpointer user_data)
+                                           gpointer user_data)
 {
-    gint *new_value = user_data;
+    TabWidth *tw = user_data;
     GtkWidget *label;
 
-    ENTER("page %p, visible %d", page, *new_value);
+    ENTER("page %p, tab width %d, tabs on left or right %d",
+           page, tw->tab_width, tw->tabs_left_right);
+
     label = g_object_get_data(G_OBJECT (page), PLUGIN_PAGE_TAB_LABEL);
     if (!label)
     {
         LEAVE("no label");
         return;
     }
-    gnc_main_window_set_tab_ellipsize (label, *new_value);
+    gnc_main_window_set_tab_ellipsize (label, tw->tab_width, tw->tabs_left_right);
     LEAVE(" ");
 }
 
@@ -2244,13 +2282,15 @@ gnc_main_window_update_tab_width_one_page (GncPluginPage *page,
 static void
 gnc_main_window_update_tab_width (gpointer prefs, gchar *pref, gpointer user_data)
 {
-    gint new_value;
+    TabWidth *tw;
 
     ENTER(" ");
-    new_value = gnc_prefs_get_float (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_WIDTH);
-    gnc_main_window_foreach_page(
-        gnc_main_window_update_tab_width_one_page,
-        &new_value);
+
+    tw = populate_tab_width_struct ();
+
+    gnc_main_window_foreach_page (gnc_main_window_update_tab_width_one_page, tw);
+    g_free (tw);
+
     LEAVE(" ");
 }
 
@@ -2343,7 +2383,7 @@ main_window_update_page_name (GncPluginPage *page,
     GncMainWindowPrivate *priv;
     GtkWidget *label, *entry;
     gchar *name, *old_page_name, *old_page_long_name;
-    gint lab_width;
+    TabWidth *tw;
 
     ENTER(" ");
 
@@ -2383,8 +2423,9 @@ main_window_update_page_name (GncPluginPage *page,
         gtk_label_set_text(GTK_LABEL(label), name);
 
     /* Adjust the label width for new text */
-    lab_width = gnc_prefs_get_float (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_WIDTH);
-    gnc_main_window_update_tab_width_one_page (page, &lab_width);
+    tw = populate_tab_width_struct ();
+    gnc_main_window_update_tab_width_one_page (page, tw);
+    g_free (tw);
 
     /* Update Tooltip on notebook Tab */
     if (old_page_long_name && old_page_name
@@ -3200,7 +3241,7 @@ gnc_main_window_open_page (GncMainWindow *window,
     const gchar *icon, *text, *color_string, *lab_text;
     GtkWidget *image;
     GList *tmp;
-    gint width;
+    TabWidth *tw;
 
     ENTER("window %p, page %p", window, page);
     if (window)
@@ -3244,13 +3285,14 @@ gnc_main_window_open_page (GncMainWindow *window,
     /*
      * The page tab.
      */
-    width = gnc_prefs_get_float(GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_WIDTH);
     icon = GNC_PLUGIN_PAGE_GET_CLASS(page)->tab_icon;
     lab_text = gnc_plugin_page_get_page_name(page);
     label = gtk_label_new (lab_text);
     g_object_set_data (G_OBJECT (page), PLUGIN_PAGE_TAB_LABEL, label);
 
-    gnc_main_window_set_tab_ellipsize (label, width);
+    tw = populate_tab_width_struct ();
+    gnc_main_window_update_tab_width_one_page (page, tw);
+    g_free (tw);
 
     gtk_widget_show (label);
 
@@ -3651,6 +3693,8 @@ gnc_main_window_update_tab_position (gpointer prefs, gchar *pref, gpointer user_
                                        G_CALLBACK (gnc_main_window_cmd_view_tab_position),
                                        window);
 
+    gnc_main_window_update_tab_width (NULL, GNC_PREF_TAB_WIDTH, NULL);
+
     LEAVE ("");
 }
 

commit 6cad1d16afd487e5e4c1cbe50083828c56f3ce60
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Fri Jul 29 10:49:32 2022 +0100

    Change source files gnc-ab-utils.* for spaces and tabs

diff --git a/gnucash/import-export/aqb/gnc-ab-utils.c b/gnucash/import-export/aqb/gnc-ab-utils.c
index 28e5b48e2..d6d5b01dd 100644
--- a/gnucash/import-export/aqb/gnc-ab-utils.c
+++ b/gnucash/import-export/aqb/gnc-ab-utils.c
@@ -67,17 +67,17 @@ G_GNUC_UNUSED static QofLogModule log_module = G_LOG_DOMAIN;
 static AB_BANKING *gnc_AB_BANKING = NULL;
 static gint gnc_AB_BANKING_refcount = 0;
 
-static gpointer join_ab_strings_cb(const gchar *str, gpointer user_data);
-static Account *gnc_ab_accinfo_to_gnc_acc(GtkWidget *parent,
-    AB_IMEXPORTER_ACCOUNTINFO *account_info);
-static Account *gnc_ab_txn_to_gnc_acc(GtkWidget *parent,
-    const AB_TRANSACTION *transaction);
-static const AB_TRANSACTION *txn_transaction_cb(
-    const AB_TRANSACTION *element, gpointer user_data);
-static AB_IMEXPORTER_ACCOUNTINFO *txn_accountinfo_cb(
-    AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data);
-static AB_IMEXPORTER_ACCOUNTINFO *bal_accountinfo_cb(
-    AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data);
+static gpointer join_ab_strings_cb (const gchar *str, gpointer user_data);
+static Account *gnc_ab_accinfo_to_gnc_acc (GtkWidget *parent,
+                                           AB_IMEXPORTER_ACCOUNTINFO *account_info);
+static Account *gnc_ab_txn_to_gnc_acc (GtkWidget *parent,
+                                       const AB_TRANSACTION *transaction);
+static const AB_TRANSACTION *txn_transaction_cb (const AB_TRANSACTION *element,
+                                                 gpointer user_data);
+static AB_IMEXPORTER_ACCOUNTINFO *txn_accountinfo_cb (AB_IMEXPORTER_ACCOUNTINFO *element,
+                                                      gpointer user_data);
+static AB_IMEXPORTER_ACCOUNTINFO *bal_accountinfo_cb (AB_IMEXPORTER_ACCOUNTINFO *element,
+                                                      gpointer user_data);
 
 struct _GncABImExContextImport
 {
@@ -102,69 +102,69 @@ static inline time64
 gnc_gwen_date_to_time64 (const GNC_GWEN_DATE* date)
 {
 #if AQBANKING_VERSION_INT >= 59900
-    int day = GWEN_Date_GetDay(date);
-    int month = GWEN_Date_GetMonth(date);
-    int year = GWEN_Date_GetYear(date);
+    int day = GWEN_Date_GetDay (date);
+    int month = GWEN_Date_GetMonth (date);
+    int year = GWEN_Date_GetYear (date);
     /* Some banks use nominal 30-day months and set the value date as
      * the day after the posted date. In February this can appear to
      * be an invalid date because February has fewer than 30 days. If
      * that's the case then back up a day to get a real date for
      * posting.
      */
-    while (month == 2 && day <= 30 && day > (is_leap_year(year) ? 29 : 28))
+    while (month == 2 && day <= 30 && day > (is_leap_year (year) ? 29 : 28))
         --day;
-    return gnc_dmy2time64_neutral(day, month, year);
+    return gnc_dmy2time64_neutral (day, month, year);
 #else
     int month, day, year;
-    GWEN_Time_GetBrokenDownDate(date, &day, &month, &year);
+    GWEN_Time_GetBrokenDownDate (date, &day, &month, &year);
     /* GWEN_Time_GetBrokenDownDate returns localtime(3) format; month is [0..11] */
-    return gnc_dmy2time64_neutral(day, month + 1, year);
+    return gnc_dmy2time64_neutral (day, month + 1, year);
 #endif
 }
 
 void
-gnc_GWEN_Init(void)
+gnc_GWEN_Init (void)
 {
-    gchar* gwen_logging = g_strdup(g_getenv("GWEN_LOGLEVEL"));
-    gchar* aqb_logging = g_strdup(g_getenv("AQBANKING_LOGLEVEL"));
+    gchar* gwen_logging = g_strdup (g_getenv ("GWEN_LOGLEVEL"));
+    gchar* aqb_logging = g_strdup (g_getenv ("AQBANKING_LOGLEVEL"));
 
     /* Initialize gwen library */
     GWEN_Init();
 
     /* Initialize gwen logging */
-    if (gnc_prefs_get_bool(GNC_PREFS_GROUP_AQBANKING, GNC_PREF_VERBOSE_DEBUG))
+    if (gnc_prefs_get_bool (GNC_PREFS_GROUP_AQBANKING, GNC_PREF_VERBOSE_DEBUG))
     {
         if (!gwen_logging)
         {
-            GWEN_Logger_SetLevel(NULL, GWEN_LoggerLevel_Info);
-            GWEN_Logger_SetLevel(GWEN_LOGDOMAIN, GWEN_LoggerLevel_Info);
+            GWEN_Logger_SetLevel (NULL, GWEN_LoggerLevel_Info);
+            GWEN_Logger_SetLevel (GWEN_LOGDOMAIN, GWEN_LoggerLevel_Info);
         }
         if (!aqb_logging)
-            GWEN_Logger_SetLevel(AQBANKING_LOGDOMAIN, GWEN_LoggerLevel_Debug);
+            GWEN_Logger_SetLevel (AQBANKING_LOGDOMAIN, GWEN_LoggerLevel_Debug);
     }
     else
     {
         if (!gwen_logging)
         {
-            GWEN_Logger_SetLevel(NULL, GWEN_LoggerLevel_Error);
-            GWEN_Logger_SetLevel(GWEN_LOGDOMAIN, GWEN_LoggerLevel_Error);
+            GWEN_Logger_SetLevel (NULL, GWEN_LoggerLevel_Error);
+            GWEN_Logger_SetLevel (GWEN_LOGDOMAIN, GWEN_LoggerLevel_Error);
         }
         if (!aqb_logging)
-            GWEN_Logger_SetLevel(AQBANKING_LOGDOMAIN, GWEN_LoggerLevel_Warning);
+            GWEN_Logger_SetLevel (AQBANKING_LOGDOMAIN, GWEN_LoggerLevel_Warning);
     }
-    g_free(gwen_logging);
-    g_free(aqb_logging);
+    g_free (gwen_logging);
+    g_free (aqb_logging);
     gnc_GWEN_Gui_log_init();
 }
 
 void
-gnc_GWEN_Fini(void)
+gnc_GWEN_Fini (void)
 {
     /* Shutdown the GWEN_GUIs */
     gnc_GWEN_Gui_shutdown();
-    GWEN_Logger_SetLevel(NULL, GWEN_LoggerLevel_Error);
-    GWEN_Logger_SetLevel(GWEN_LOGDOMAIN, GWEN_LoggerLevel_Warning);
-    GWEN_Logger_SetLevel(AQBANKING_LOGDOMAIN, GWEN_LoggerLevel_Warning);
+    GWEN_Logger_SetLevel (NULL, GWEN_LoggerLevel_Error);
+    GWEN_Logger_SetLevel (GWEN_LOGDOMAIN, GWEN_LoggerLevel_Warning);
+    GWEN_Logger_SetLevel (AQBANKING_LOGDOMAIN, GWEN_LoggerLevel_Warning);
 
     /* Finalize gwen library */
     GWEN_Fini();
@@ -173,7 +173,7 @@ gnc_GWEN_Fini(void)
 static GWEN_GUI *gnc_gwengui_extended_by_ABBanking;
 
 AB_BANKING *
-gnc_AB_BANKING_new(void)
+gnc_AB_BANKING_new (void)
 {
     AB_BANKING *api;
 
@@ -184,13 +184,13 @@ gnc_AB_BANKING_new(void)
 
         /* Init the API again. */
         if (gnc_AB_BANKING_refcount == 0)
-            g_return_val_if_fail(AB_Banking_Init(api) == 0, NULL);
+            g_return_val_if_fail (AB_Banking_Init (api) == 0, NULL);
 
     }
     else
     {
-        api = AB_Banking_new("gnucash", NULL, 0);
-        g_return_val_if_fail(api, NULL);
+        api = AB_Banking_new ("gnucash", NULL, 0);
+        g_return_val_if_fail (api, NULL);
 
 #if AQBANKING_VERSION_INT >= 59925 \
     || (AQBANKING_VERSION_INT >= 50709 && AQBANKING_VERSION_INT < 59900)
@@ -200,26 +200,26 @@ gnc_AB_BANKING_new(void)
         https://www.hbci-zka.de/register/prod_register.htm (where the
         registration was requested and is managed by cstim). The function call was
         introduced in aqbanking-5.99.25 and aqbanking-5.7.9. */
-        AB_Banking_RuntimeConfig_SetCharValue(api, "fintsRegistrationKey", "412748A1836CDD07181CE1910");
-        AB_Banking_RuntimeConfig_SetCharValue(api, "fintsApplicationVersionString", PROJECT_VERSION);
+        AB_Banking_RuntimeConfig_SetCharValue (api, "fintsRegistrationKey", "412748A1836CDD07181CE1910");
+        AB_Banking_RuntimeConfig_SetCharValue (api, "fintsApplicationVersionString", PROJECT_VERSION);
 #endif
 
 #ifndef AQBANKING6
         /* Check for config migration */
-        if (AB_Banking_HasConf4(api) != 0)
+        if (AB_Banking_HasConf4 (api) != 0)
         {
-            if (AB_Banking_HasConf3(api) == 0)
+            if (AB_Banking_HasConf3 (api) == 0)
             {
                 PINFO("gnc_AB_BANKING_new: importing aqbanking3 configuration\n");
-                if (AB_Banking_ImportConf3(api) < 0)
+                if (AB_Banking_ImportConf3 (api) < 0)
                 {
                     PINFO("gnc_AB_BANKING_new: unable to import aqbanking3 configuration\n");
                 }
             }
-            else if (AB_Banking_HasConf2(api) == 0)
+            else if (AB_Banking_HasConf2 (api) == 0)
             {
                 PINFO("gnc_AB_BANKING_new: importing aqbanking2 configuration\n");
-                if (AB_Banking_ImportConf2(api) < 0)
+                if (AB_Banking_ImportConf2 (api) < 0)
                 {
                     PINFO("gnc_AB_BANKING_new: unable to import aqbanking2 configuration\n");
                 }
@@ -228,9 +228,9 @@ gnc_AB_BANKING_new(void)
 #endif
 
         /* Init the API */
-        g_return_val_if_fail(AB_Banking_Init(api) == 0, NULL);
-        gnc_gwengui_extended_by_ABBanking = GWEN_Gui_GetGui();
-        AB_Gui_Extend(gnc_gwengui_extended_by_ABBanking, api);
+        g_return_val_if_fail (AB_Banking_Init (api) == 0, NULL);
+        gnc_gwengui_extended_by_ABBanking = GWEN_Gui_GetGui ();
+        AB_Gui_Extend (gnc_gwengui_extended_by_ABBanking, api);
 
         /* Cache it */
         gnc_AB_BANKING = api;
@@ -243,7 +243,7 @@ gnc_AB_BANKING_new(void)
 }
 
 void
-gnc_AB_BANKING_delete(AB_BANKING *api)
+gnc_AB_BANKING_delete (AB_BANKING *api)
 {
     if (!api)
         api = gnc_AB_BANKING;
@@ -253,47 +253,47 @@ gnc_AB_BANKING_delete(AB_BANKING *api)
         if (api == gnc_AB_BANKING)
         {
             gnc_AB_BANKING = NULL;
-            gnc_AB_BANKING_fini(api);
+            gnc_AB_BANKING_fini (api);
         }
 
-        AB_Banking_free(api);
+        AB_Banking_free (api);
     }
 }
 
 
 gint
-gnc_AB_BANKING_fini(AB_BANKING *api)
+gnc_AB_BANKING_fini (AB_BANKING *api)
 {
     if (api == gnc_AB_BANKING)
     {
         if (--gnc_AB_BANKING_refcount == 0)
         {
             if (gnc_gwengui_extended_by_ABBanking)
-                AB_Gui_Unextend(gnc_gwengui_extended_by_ABBanking);
+                AB_Gui_Unextend (gnc_gwengui_extended_by_ABBanking);
             gnc_gwengui_extended_by_ABBanking = NULL;
-            return AB_Banking_Fini(api);
+            return AB_Banking_Fini (api);
         }
     }
     else
     {
         if (gnc_gwengui_extended_by_ABBanking)
-            AB_Gui_Unextend(gnc_gwengui_extended_by_ABBanking);
+            AB_Gui_Unextend (gnc_gwengui_extended_by_ABBanking);
         gnc_gwengui_extended_by_ABBanking = NULL;
-        return AB_Banking_Fini(api);
+        return AB_Banking_Fini (api);
     }
     return 0;
 }
 
 GNC_AB_ACCOUNT_SPEC *
-gnc_ab_get_ab_account(const AB_BANKING *api, Account *gnc_acc)
+gnc_ab_get_ab_account (const AB_BANKING *api, Account *gnc_acc)
 {
     GNC_AB_ACCOUNT_SPEC *ab_account = NULL;
     const gchar *bankcode = NULL;
     const gchar *accountid = NULL;
     guint32 account_uid = 0;
 
-    bankcode = gnc_ab_get_account_bankcode(gnc_acc);
-    accountid = gnc_ab_get_account_accountid(gnc_acc);
+    bankcode = gnc_ab_get_account_bankcode (gnc_acc);
+    accountid = gnc_ab_get_account_accountid (gnc_acc);
     account_uid = gnc_ab_get_account_uid (gnc_acc);
 
     if (account_uid > 0)
@@ -301,7 +301,7 @@ gnc_ab_get_ab_account(const AB_BANKING *api, Account *gnc_acc)
 #ifdef AQBANKING6
         gint rv;
 
-        rv = AB_Banking_GetAccountSpecByUniqueId(api, account_uid, &ab_account);
+        rv = AB_Banking_GetAccountSpecByUniqueId (api, account_uid, &ab_account);
 
         if ( (rv<0 || !ab_account) && bankcode && *bankcode &&
              accountid && *accountid)
@@ -315,22 +315,22 @@ gnc_ab_get_ab_account(const AB_BANKING *api, Account *gnc_acc)
         }
         return ab_account;
 #else
-        ab_account = AB_Banking_GetAccount(api, account_uid);
+        ab_account = AB_Banking_GetAccount (api, account_uid);
 
         if (!ab_account && bankcode && *bankcode && accountid && *accountid)
         {
             PINFO("gnc_ab_get_ab_account: No AB_ACCOUNT found for UID %d, "
                       "trying bank code\n", account_uid);
-            ab_account = AB_Banking_GetAccountByCodeAndNumber(api, bankcode,
-                                                              accountid);
+            ab_account = AB_Banking_GetAccountByCodeAndNumber (api, bankcode,
+                                                               accountid);
         }
         return ab_account;
 
     }
     else if (bankcode && *bankcode && accountid && *accountid)
     {
-        ab_account = AB_Banking_GetAccountByCodeAndNumber(api, bankcode,
-                     accountid);
+        ab_account = AB_Banking_GetAccountByCodeAndNumber (api, bankcode,
+                                                           accountid);
         return ab_account;
 #endif
     }
@@ -339,19 +339,19 @@ gnc_ab_get_ab_account(const AB_BANKING *api, Account *gnc_acc)
 }
 
 gchar *
-gnc_AB_VALUE_to_readable_string(const AB_VALUE *value)
+gnc_AB_VALUE_to_readable_string (const AB_VALUE *value)
 {
     if (value)
-        return g_strdup_printf("%.2f %s",
-                               AB_Value_GetValueAsDouble(value),
-                               AB_Value_GetCurrency(value));
+        return g_strdup_printf ("%.2f %s",
+                                AB_Value_GetValueAsDouble (value),
+                                AB_Value_GetCurrency (value));
     else
-        return g_strdup_printf("%.2f", 0.0);
+        return g_strdup_printf ("%.2f", 0.0);
 }
 
 
 gchar*
-gnc_ab_create_online_id(const gchar *bankcode, const gchar *accountnumber)
+gnc_ab_create_online_id (const gchar *bankcode, const gchar *accountnumber)
 {
     gchar *online_id;
 
@@ -364,9 +364,9 @@ gnc_ab_create_online_id(const gchar *bankcode, const gchar *accountnumber)
     while (accountnumber && *accountnumber == '0')
         accountnumber++;
 
-    online_id = g_strconcat(bankcode ? bankcode : "",
-                            accountnumber ? accountnumber : "",
-                            (gchar*)NULL);
+    online_id = g_strconcat (bankcode ? bankcode : "",
+                             accountnumber ? accountnumber : "",
+                             (gchar*)NULL);
 
     return online_id;
 }
@@ -376,7 +376,7 @@ gnc_ab_create_online_id(const gchar *bankcode, const gchar *accountnumber)
  * to the rest.
  */
 static gpointer
-join_ab_strings_cb(const gchar *str, gpointer user_data)
+join_ab_strings_cb (const gchar *str, gpointer user_data)
 {
     gchar **acc = user_data;
     gchar *tmp;
@@ -384,15 +384,15 @@ join_ab_strings_cb(const gchar *str, gpointer user_data)
     if (!str || !*str)
         return NULL;
 
-    tmp = g_strdup(str);
-    g_strstrip(tmp);
-    gnc_utf8_strip_invalid_and_controls(tmp);
+    tmp = g_strdup (str);
+    g_strstrip (tmp);
+    gnc_utf8_strip_invalid_and_controls (tmp);
 
     if (*acc)
     {
-        gchar *join = g_strjoin(" ", *acc, tmp, (gchar*) NULL);
-        g_free(*acc);
-        g_free(tmp);
+        gchar *join = g_strjoin (" ", *acc, tmp, (gchar*) NULL);
+        g_free (*acc);
+        g_free (tmp);
         *acc = join;
     }
     else
@@ -403,7 +403,7 @@ join_ab_strings_cb(const gchar *str, gpointer user_data)
 }
 
 gchar *
-gnc_ab_get_remote_name(const AB_TRANSACTION *ab_trans)
+gnc_ab_get_remote_name (const AB_TRANSACTION *ab_trans)
 {
 #ifdef AQBANKING6
     const char* ab_remote_name;
@@ -412,19 +412,19 @@ gnc_ab_get_remote_name(const AB_TRANSACTION *ab_trans)
 #endif
     gchar *gnc_other_name = NULL;
 
-    g_return_val_if_fail(ab_trans, NULL);
+    g_return_val_if_fail (ab_trans, NULL);
 
-    ab_remote_name = AB_Transaction_GetRemoteName(ab_trans);
+    ab_remote_name = AB_Transaction_GetRemoteName (ab_trans);
     if (ab_remote_name)
 #ifdef AQBANKING6
         gnc_other_name = g_strdup(ab_remote_name);
 #else
-        GWEN_StringList_ForEach(ab_remote_name, join_ab_strings_cb,
-                                &gnc_other_name);
+        GWEN_StringList_ForEach (ab_remote_name, join_ab_strings_cb,
+                                 &gnc_other_name);
 #endif
     if (!gnc_other_name || !*gnc_other_name)
     {
-        g_free(gnc_other_name);
+        g_free (gnc_other_name);
         gnc_other_name = NULL;
     }
 
@@ -432,7 +432,7 @@ gnc_ab_get_remote_name(const AB_TRANSACTION *ab_trans)
 }
 
 gchar *
-gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans, gboolean is_ofx)
+gnc_ab_get_purpose (const AB_TRANSACTION *ab_trans, gboolean is_ofx)
 {
 #ifdef AQBANKING6
 #  if AQBANKING_VERSION_INT < 59929
@@ -445,16 +445,16 @@ gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans, gboolean is_ofx)
     const char *ab_transactionText = NULL;
     gchar *gnc_description = NULL;
 
-    g_return_val_if_fail(ab_trans, g_strdup(""));
+    g_return_val_if_fail (ab_trans, g_strdup (""));
 
-    if (!is_ofx && gnc_prefs_get_bool(GNC_PREFS_GROUP_AQBANKING, GNC_PREF_USE_TRANSACTION_TXT))
+    if (!is_ofx && gnc_prefs_get_bool (GNC_PREFS_GROUP_AQBANKING, GNC_PREF_USE_TRANSACTION_TXT))
     {
         /* According to AqBanking, some of the non-swift lines have a special
          * meaning. Some banks place valuable text into the transaction text,
          * hence we put this text in front of the purpose. */
-        ab_transactionText = AB_Transaction_GetTransactionText(ab_trans);
+        ab_transactionText = AB_Transaction_GetTransactionText (ab_trans);
         if (ab_transactionText)
-            gnc_description = g_strdup(ab_transactionText);
+            gnc_description = g_strdup (ab_transactionText);
     }
 
     ab_purpose =
@@ -466,63 +466,63 @@ gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans, gboolean is_ofx)
 #endif
             (ab_trans);
     if (ab_purpose)
-        GWEN_StringList_ForEach(ab_purpose, join_ab_strings_cb,
-                                &gnc_description);
+        GWEN_StringList_ForEach (ab_purpose, join_ab_strings_cb,
+                                 &gnc_description);
 
 #ifdef AQBANKING6
     /* With aqbanking>=5.99, the return value must now be free'd */
-    GWEN_StringList_free(ab_purpose);
+    GWEN_StringList_free (ab_purpose);
 #endif
 
     if (!gnc_description)
-        gnc_description = g_strdup("");
+        gnc_description = g_strdup ("");
 
     return gnc_description;
 }
 
 gchar *
-gnc_ab_description_to_gnc(const AB_TRANSACTION *ab_trans, gboolean is_ofx)
+gnc_ab_description_to_gnc (const AB_TRANSACTION *ab_trans, gboolean is_ofx)
 {
     /* Description */
-    gchar *description = gnc_ab_get_purpose(ab_trans, is_ofx);
-    gchar *other_name = gnc_ab_get_remote_name(ab_trans);
+    gchar *description = gnc_ab_get_purpose (ab_trans, is_ofx);
+    gchar *other_name = gnc_ab_get_remote_name (ab_trans);
     gchar *retval;
 
     if (other_name)
     {
         if (description && *description)
         {
-            retval = g_strdup_printf("%s; %s", description, other_name);
+            retval = g_strdup_printf ("%s; %s", description, other_name);
         }
         else
         {
-            retval = g_strdup(other_name);
+            retval = g_strdup (other_name);
         }
     }
     else
     {
         if (description && *description)
         {
-            retval = g_strdup(description);
+            retval = g_strdup (description);
         }
         else
         {
-            retval = g_strdup(_("Unspecified"));
+            retval = g_strdup (_("Unspecified"));
         }
     }
-    g_free(description);
-    g_free(other_name);
+    g_free (description);
+    g_free (other_name);
 
     return retval;
 }
 
 gchar *
-gnc_ab_memo_to_gnc(const AB_TRANSACTION *ab_trans)
+gnc_ab_memo_to_gnc (const AB_TRANSACTION *ab_trans)
 {
     const gchar *ab_remote_accountnumber =
-        AB_Transaction_GetRemoteAccountNumber(ab_trans);
+        AB_Transaction_GetRemoteAccountNumber (ab_trans);
     const gchar *ab_remote_bankcode =
-        AB_Transaction_GetRemoteBankCode(ab_trans);
+        AB_Transaction_GetRemoteBankCode (ab_trans);
 
     gchar *ab_other_accountid;
     gchar *ab_other_bankcode;
@@ -534,20 +534,20 @@ gnc_ab_memo_to_gnc(const AB_TRANSACTION *ab_trans)
 
     // For SEPA transactions, we need to ask for something different here
     if (!ab_remote_accountnumber)
-        ab_remote_accountnumber = AB_Transaction_GetRemoteIban(ab_trans);
+        ab_remote_accountnumber = AB_Transaction_GetRemoteIban (ab_trans);
     if (!ab_remote_bankcode)
-        ab_remote_bankcode = AB_Transaction_GetRemoteBic(ab_trans);
+        ab_remote_bankcode = AB_Transaction_GetRemoteBic (ab_trans);
 
-    ab_other_accountid = g_strdup(ab_remote_accountnumber ? ab_remote_accountnumber : "");
-    ab_other_bankcode = g_strdup(ab_remote_bankcode ? ab_remote_bankcode : "");
+    ab_other_accountid = g_strdup (ab_remote_accountnumber ? ab_remote_accountnumber : "");
+    ab_other_bankcode = g_strdup (ab_remote_bankcode ? ab_remote_bankcode : "");
 
     /* Ensure string is in utf8 */
-    gnc_utf8_strip_invalid(ab_other_accountid);
-    gnc_utf8_strip_invalid(ab_other_bankcode);
+    gnc_utf8_strip_invalid (ab_other_accountid);
+    gnc_utf8_strip_invalid (ab_other_bankcode);
 
     /* and -then- trim it */
-    g_strstrip(ab_other_accountid);
-    g_strstrip(ab_other_bankcode);
+    g_strstrip (ab_other_accountid);
+    g_strstrip (ab_other_bankcode);
 
 
     have_accountid = ab_other_accountid && *ab_other_accountid;
@@ -555,27 +555,27 @@ gnc_ab_memo_to_gnc(const AB_TRANSACTION *ab_trans)
 
     if ( have_accountid || have_bankcode )
     {
-        retval = g_strdup_printf("%s %s %s %s",
-                                 have_accountid ? _("Account") : "",
-                                 have_accountid ? ab_other_accountid : "",
-                                 have_bankcode  ? _("Bank") : "",
-                                 have_bankcode  ? ab_other_bankcode : ""
-                                );
-        g_strstrip(retval);
+        retval = g_strdup_printf ("%s %s %s %s",
+                                  have_accountid ? _("Account") : "",
+                                  have_accountid ? ab_other_accountid : "",
+                                  have_bankcode  ? _("Bank") : "",
+                                  have_bankcode  ? ab_other_bankcode : ""
+                                 );
+        g_strstrip (retval);
     }
     else
     {
-        retval = g_strdup("");
+        retval = g_strdup ("");
     }
 
-    g_free(ab_other_accountid);
-    g_free(ab_other_bankcode);
+    g_free (ab_other_accountid);
+    g_free (ab_other_bankcode);
 
     return retval;
 }
 
 Transaction *
-gnc_ab_trans_to_gnc(const AB_TRANSACTION *ab_trans, Account *gnc_acc)
+gnc_ab_trans_to_gnc (const AB_TRANSACTION *ab_trans, Account *gnc_acc)
 {
     QofBook *book;
     Transaction *gnc_trans;
@@ -587,12 +587,12 @@ gnc_ab_trans_to_gnc(const AB_TRANSACTION *ab_trans, Account *gnc_acc)
     Split *split;
     gchar *memo;
 
-    g_return_val_if_fail(ab_trans && gnc_acc, NULL);
+    g_return_val_if_fail (ab_trans && gnc_acc, NULL);
 
     /* Create new GnuCash transaction for the given AqBanking one */
-    book = gnc_account_get_book(gnc_acc);
-    gnc_trans = xaccMallocTransaction(book);
-    xaccTransBeginEdit(gnc_trans);
+    book = gnc_account_get_book (gnc_acc);
+    gnc_trans = xaccMallocTransaction (book);
+    xaccTransBeginEdit (gnc_trans);
 
     /* Date / Time */
     /* SWIFT import formats (in particular MT940) provide for two
@@ -605,57 +605,56 @@ gnc_ab_trans_to_gnc(const AB_TRANSACTION *ab_trans, Account *gnc_acc)
      * last balance instead of using the value date or NULL, making
      * the field unreliable.
      */
-    value_date = AB_Transaction_GetValutaDate(ab_trans);
+    value_date = AB_Transaction_GetValutaDate (ab_trans);
     if (value_date)
-         post_time = gnc_gwen_date_to_time64(value_date);
-    else if ((post_date = AB_Transaction_GetDate(ab_trans))) // always true
-         post_time = gnc_gwen_date_to_time64(post_date);
+         post_time = gnc_gwen_date_to_time64 (value_date);
+    else if ((post_date = AB_Transaction_GetDate (ab_trans))) // always true
+         post_time = gnc_gwen_date_to_time64 (post_date);
     else
     {
-        g_warning("transaction_cb: Import had no transaction date");
+        g_warning ("transaction_cb: Import had no transaction date");
         post_time = gnc_time (NULL);
     }
-    xaccTransSetDatePostedSecsNormalized(gnc_trans, post_time);
+    xaccTransSetDatePostedSecsNormalized (gnc_trans, post_time);
 
-    xaccTransSetDateEnteredSecs(gnc_trans, gnc_time (NULL));
+    xaccTransSetDateEnteredSecs (gnc_trans, gnc_time (NULL));
 
     /* Currency.  We take simply the default currency of the gnucash account */
-    xaccTransSetCurrency(gnc_trans, xaccAccountGetCommodity(gnc_acc));
+    xaccTransSetCurrency (gnc_trans, xaccAccountGetCommodity (gnc_acc));
 
     /* Trans-Num or Split-Action set with gnc_set_num_action below per book
      * option */
 
-    fitid = AB_Transaction_GetFiId(ab_trans);
+    fitid = AB_Transaction_GetFiId (ab_trans);
 
     /* Description */
-    description = gnc_ab_description_to_gnc(ab_trans, (fitid && *fitid));
-    xaccTransSetDescription(gnc_trans, description);
-    g_free(description);
+    description = gnc_ab_description_to_gnc (ab_trans, (fitid && *fitid));
+    xaccTransSetDescription (gnc_trans, description);
+    g_free (description);
 
     /* Notes. */
     /* xaccTransSetNotes(gnc_trans, g_notes); */
     /* But Nobody ever uses the Notes field? */
 
     /* Add one split */
-    split = xaccMallocSplit(book);
-    xaccSplitSetParent(split, gnc_trans);
-    xaccSplitSetAccount(split, gnc_acc);
+    split = xaccMallocSplit (book);
+    xaccSplitSetParent (split, gnc_trans);
+    xaccSplitSetAccount (split, gnc_acc);
 
     /* Set the transaction number or split action field based on book option.
      * We use the "customer reference", if there is one. */
-    custref = AB_Transaction_GetCustomerReference(ab_trans);
-    if (custref && *custref
-            && g_ascii_strncasecmp(custref, "NONREF", 6) != 0)
+    custref = AB_Transaction_GetCustomerReference (ab_trans);
+    if (custref && *custref && g_ascii_strncasecmp (custref, "NONREF", 6) != 0)
         gnc_set_num_action (gnc_trans, split, custref, NULL);
 
     /* Set OFX unique transaction ID */
     if (fitid && *fitid)
-        gnc_import_set_split_online_id(split, fitid);
+        gnc_import_set_split_online_id (split, fitid);
 
     /* FIXME: Extract function */
     {
         /* Amount into the split */
-        const AB_VALUE *ab_value = AB_Transaction_GetValue(ab_trans);
+        const AB_VALUE *ab_value = AB_Transaction_GetValue (ab_trans);
         double d_value = ab_value ? AB_Value_GetValueAsDouble (ab_value) : 0.0;
         AB_TRANSACTION_TYPE ab_type = AB_Transaction_GetType (ab_trans);
         gnc_numeric gnc_amount;
@@ -667,19 +666,19 @@ gnc_ab_trans_to_gnc(const AB_TRANSACTION *ab_trans, Account *gnc_acc)
         if (d_value > 0.0 && ab_type == AB_Transaction_TypeTransfer)
             d_value = -d_value;
 
-        gnc_amount = double_to_gnc_numeric(
+        gnc_amount = double_to_gnc_numeric (
                          d_value,
-                         xaccAccountGetCommoditySCU(gnc_acc),
+                         xaccAccountGetCommoditySCU (gnc_acc),
                          GNC_HOW_RND_ROUND_HALF_UP);
         if (!ab_value)
-            g_warning("transaction_cb: Oops, value was NULL.  Using 0");
-        xaccSplitSetBaseValue(split, gnc_amount, xaccAccountGetCommodity(gnc_acc));
+            g_warning ("transaction_cb: Oops, value was NULL.  Using 0");
+        xaccSplitSetBaseValue (split, gnc_amount, xaccAccountGetCommodity (gnc_acc));
     }
 
     /* Memo in the Split. */
-    memo = gnc_ab_memo_to_gnc(ab_trans);
-    xaccSplitSetMemo(split, memo);
-    g_free(memo);
+    memo = gnc_ab_memo_to_gnc (ab_trans);
+    xaccSplitSetMemo (split, memo);
+    g_free (memo);
 
     return gnc_trans;
 }
@@ -693,26 +692,26 @@ gnc_ab_trans_to_gnc(const AB_TRANSACTION *ab_trans, Account *gnc_acc)
  * @return A GnuCash account, or NULL otherwise
  */
 static Account *
-gnc_ab_accinfo_to_gnc_acc(GtkWidget *parent, AB_IMEXPORTER_ACCOUNTINFO *acc_info)
+gnc_ab_accinfo_to_gnc_acc (GtkWidget *parent, AB_IMEXPORTER_ACCOUNTINFO *acc_info)
 {
     const gchar *bankcode, *accountnumber;
     gchar *online_id;
     Account *gnc_acc;
 
-    g_return_val_if_fail(acc_info, NULL);
+    g_return_val_if_fail (acc_info, NULL);
 
-    bankcode = AB_ImExporterAccountInfo_GetBankCode(acc_info);
-    accountnumber = AB_ImExporterAccountInfo_GetAccountNumber(acc_info);
-    online_id = gnc_ab_create_online_id(bankcode, accountnumber);
-    gnc_acc = gnc_import_select_account(
-                  parent, online_id, 1, AB_ImExporterAccountInfo_GetAccountName(acc_info),
+    bankcode = AB_ImExporterAccountInfo_GetBankCode (acc_info);
+    accountnumber = AB_ImExporterAccountInfo_GetAccountNumber (acc_info);
+    online_id = gnc_ab_create_online_id (bankcode, accountnumber);
+    gnc_acc = gnc_import_select_account (parent, online_id, 1, 
+                  AB_ImExporterAccountInfo_GetAccountName (acc_info),
                   NULL, ACCT_TYPE_NONE, NULL, NULL);
     if (!gnc_acc)
     {
-        g_warning("gnc_ab_accinfo_to_gnc_acc: Could not determine source account"
-                  " for online_id %s", online_id);
+        g_warning ("gnc_ab_accinfo_to_gnc_acc: Could not determine source account"
+                   " for online_id %s", online_id);
     }
-    g_free(online_id);
+    g_free (online_id);
 
     return gnc_acc;
 }
@@ -727,7 +726,7 @@ gnc_ab_accinfo_to_gnc_acc(GtkWidget *parent, AB_IMEXPORTER_ACCOUNTINFO *acc_info
  * @return A GnuCash account, or NULL otherwise
  */
 static Account *
-gnc_ab_txn_to_gnc_acc(GtkWidget *parent, const AB_TRANSACTION *transaction)
+gnc_ab_txn_to_gnc_acc (GtkWidget *parent, const AB_TRANSACTION *transaction)
 {
     const gchar *bankcode, *accountnumber;
     gchar *online_id;
@@ -735,63 +734,63 @@ gnc_ab_txn_to_gnc_acc(GtkWidget *parent, const AB_TRANSACTION *transaction)
 
     g_return_val_if_fail(transaction, NULL);
 
-    bankcode = AB_Transaction_GetLocalBankCode(transaction);
-    accountnumber = AB_Transaction_GetLocalAccountNumber(transaction);
+    bankcode = AB_Transaction_GetLocalBankCode (transaction);
+    accountnumber = AB_Transaction_GetLocalAccountNumber (transaction);
     if (!bankcode && !accountnumber)
     {
         return NULL;
     }
 
-    online_id = gnc_ab_create_online_id(bankcode, accountnumber);
-    gnc_acc = gnc_import_select_account(
-                  parent, online_id, 1, AB_Transaction_GetLocalName(transaction),
+    online_id = gnc_ab_create_online_id (bankcode, accountnumber);
+    gnc_acc = gnc_import_select_account (parent, online_id, 1,
+                  AB_Transaction_GetLocalName (transaction),
                   NULL, ACCT_TYPE_NONE, NULL, NULL);
     if (!gnc_acc)
     {
-        g_warning("gnc_ab_txn_to_gnc_acc: Could not determine source account"
-                  " for online_id %s", online_id);
+        g_warning ("gnc_ab_txn_to_gnc_acc: Could not determine source account"
+                   " for online_id %s", online_id);
     }
-    g_free(online_id);
+    g_free (online_id);
 
     return gnc_acc;
 }
 
 static const AB_TRANSACTION *
-txn_transaction_cb(const AB_TRANSACTION *element, gpointer user_data)
+txn_transaction_cb (const AB_TRANSACTION *element, gpointer user_data)
 {
     GncABImExContextImport *data = user_data;
     Transaction *gnc_trans;
     GncABTransType trans_type;
     Account* txnacc;
 
-    g_return_val_if_fail(element && data, NULL);
+    g_return_val_if_fail (element && data, NULL);
 
     /* Create a GnuCash transaction from ab_trans */
-    txnacc = gnc_ab_txn_to_gnc_acc(GTK_WIDGET(data->parent), element);
-    gnc_trans = gnc_ab_trans_to_gnc(element, txnacc ? txnacc : data->gnc_acc);
+    txnacc = gnc_ab_txn_to_gnc_acc (GTK_WIDGET(data->parent), element);
+    gnc_trans = gnc_ab_trans_to_gnc (element, txnacc ? txnacc : data->gnc_acc);
 
     if (data->execute_txns && data->ab_acc)
     {
-        AB_TRANSACTION *ab_trans = AB_Transaction_dup(element);
+        AB_TRANSACTION *ab_trans = AB_Transaction_dup (element);
         GNC_AB_JOB *job;
 
         /* NEW: The imported transaction has been imported into gnucash.
          * Now also add it as a job to aqbanking */
 #ifdef AQBANKING6
-        AB_Transaction_SetLocalBankCode(
-            ab_trans, AB_AccountSpec_GetBankCode(data->ab_acc));
-        AB_Transaction_SetLocalAccountNumber(
-            ab_trans, AB_AccountSpec_GetAccountNumber(data->ab_acc));
+        AB_Transaction_SetLocalBankCode (
+            ab_trans, AB_AccountSpec_GetBankCode (data->ab_acc));
+        AB_Transaction_SetLocalAccountNumber (
+            ab_trans, AB_AccountSpec_GetAccountNumber (data->ab_acc));
 #else
-        AB_Transaction_SetLocalBankCode(
-            ab_trans, AB_Account_GetBankCode(data->ab_acc));
-        AB_Transaction_SetLocalAccountNumber(
-            ab_trans, AB_Account_GetAccountNumber(data->ab_acc));
+        AB_Transaction_SetLocalBankCode (
+            ab_trans, AB_Account_GetBankCode (data->ab_acc));
+        AB_Transaction_SetLocalAccountNumber (
+            ab_trans, AB_Account_GetAccountNumber (data->ab_acc));
 #endif
-        AB_Transaction_SetLocalCountry(ab_trans, "DE");
+        AB_Transaction_SetLocalCountry (ab_trans, "DE");
 
 
-        switch (AB_Transaction_GetType(ab_trans))
+        switch (AB_Transaction_GetType (ab_trans))
         {
         case AB_Transaction_TypeDebitNote:
             trans_type = SINGLE_DEBITNOTE;
@@ -808,18 +807,18 @@ txn_transaction_cb(const AB_TRANSACTION *element, gpointer user_data)
             break;
         } /* switch */
 
-        job = gnc_ab_get_trans_job(data->ab_acc, ab_trans, trans_type);
+        job = gnc_ab_get_trans_job (data->ab_acc, ab_trans, trans_type);
 
         /* Check whether we really got a job */
 #ifdef AQBANKING6
-        if (!job || AB_AccountSpec_GetTransactionLimitsForCommand(data->ab_acc, AB_Transaction_GetCommand(job))==NULL)
+        if (!job || AB_AccountSpec_GetTransactionLimitsForCommand (data->ab_acc, AB_Transaction_GetCommand (job)) == NULL)
 #else
-        if (!job || AB_Job_CheckAvailability(job))
+        if (!job || AB_Job_CheckAvailability (job))
 #endif
         {
             /* Oops, no job, probably not supported by bank */
-            if (gnc_verify_dialog(
-                        GTK_WINDOW (data->parent), FALSE, "%s",
+            if (gnc_verify_dialog (
+                        GTK_WINDOW(data->parent), FALSE, "%s",
                         _("The backend found an error during the preparation "
                           "of the job. It is not possible to execute this job.\n"
                           "\n"
@@ -830,101 +829,101 @@ txn_transaction_cb(const AB_TRANSACTION *element, gpointer user_data)
                           "\n"
                           "Do you want to enter the job again?")))
             {
-                gnc_error_dialog (GTK_WINDOW (data->parent),
+                gnc_error_dialog (GTK_WINDOW(data->parent),
                                   "Sorry, not implemented yet. Please check the console or trace file logs to see which job was rejected.");
             }
         }
         else
         {
-            gnc_gen_trans_list_add_trans_with_ref_id(data->generic_importer,
-                                                     gnc_trans,
+            gnc_gen_trans_list_add_trans_with_ref_id (data->generic_importer,
+                                                      gnc_trans,
 #ifdef AQBANKING6
-                                                     AB_Transaction_GetUniqueId(job));
+                                                      AB_Transaction_GetUniqueId (job));
 #else
-                                                     AB_Job_GetJobId(job));
+                                                      AB_Job_GetJobId (job));
 #endif
             /* AB_Job_List2_PushBack(data->job_list, job); -> delayed until trans is successfully imported */
-            g_datalist_set_data(&data->tmp_job_list, gnc_AB_JOB_to_readable_string(job), job);
+            g_datalist_set_data (&data->tmp_job_list, gnc_AB_JOB_to_readable_string (job), job);
         }
-        AB_Transaction_free(ab_trans);
+        AB_Transaction_free (ab_trans);
     }
     else
     {
         /* Instead of xaccTransCommitEdit(gnc_trans)  */
-        gnc_gen_trans_list_add_trans(data->generic_importer, gnc_trans);
+        gnc_gen_trans_list_add_trans (data->generic_importer, gnc_trans);
     }
 
     return NULL;
 }
 
-static void gnc_ab_trans_processed_cb(GNCImportTransInfo *trans_info,
-                                      gboolean imported,
-                                      gpointer user_data)
+static void gnc_ab_trans_processed_cb (GNCImportTransInfo *trans_info,
+                                       gboolean imported,
+                                       gpointer user_data)
 {
     GncABImExContextImport *data = user_data;
-    gchar *jobname = gnc_AB_JOB_ID_to_string(gnc_import_TransInfo_get_ref_id(trans_info));
-    GNC_AB_JOB *job = g_datalist_get_data(&data->tmp_job_list, jobname);
+    gchar *jobname = gnc_AB_JOB_ID_to_string (gnc_import_TransInfo_get_ref_id (trans_info));
+    GNC_AB_JOB *job = g_datalist_get_data (&data->tmp_job_list, jobname);
 
     if (imported)
     {
 #ifdef AQBANKING6
-        AB_Transaction_List2_PushBack(data->job_list, job);
+        AB_Transaction_List2_PushBack (data->job_list, job);
 #else
-        AB_Job_List2_PushBack(data->job_list, job);
+        AB_Job_List2_PushBack (data->job_list, job);
 #endif
     }
     else
     {
 #ifdef AQBANKING6
-        AB_Transaction_free(job);
+        AB_Transaction_free (job);
 #else
-        AB_Job_free(job);
+        AB_Job_free (job);
 #endif
     }
 
-    g_datalist_remove_data(&data->tmp_job_list, jobname);
+    g_datalist_remove_data (&data->tmp_job_list, jobname);
 }
 
 gchar *
-gnc_AB_JOB_to_readable_string(const GNC_AB_JOB *job)
+gnc_AB_JOB_to_readable_string (const GNC_AB_JOB *job)
 {
     if (job)
     {
 #ifdef AQBANKING6
-        return gnc_AB_JOB_ID_to_string(AB_Transaction_GetUniqueId(job));
+        return gnc_AB_JOB_ID_to_string (AB_Transaction_GetUniqueId (job));
 #else
-        return gnc_AB_JOB_ID_to_string(AB_Job_GetJobId(job));
+        return gnc_AB_JOB_ID_to_string (AB_Job_GetJobId (job));
 #endif
     }
     else
     {
-        return gnc_AB_JOB_ID_to_string(0);
+        return gnc_AB_JOB_ID_to_string (0);
     }
 }
 gchar *
-gnc_AB_JOB_ID_to_string(gulong job_id)
+gnc_AB_JOB_ID_to_string (gulong job_id)
 {
-    return g_strdup_printf("job_%lu", job_id);
+    return g_strdup_printf ("job_%lu", job_id);
 }
 
 
 
 static AB_IMEXPORTER_ACCOUNTINFO *
-txn_accountinfo_cb(AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data)
+txn_accountinfo_cb (AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data)
 {
     GncABImExContextImport *data = user_data;
     Account *gnc_acc;
 
-    g_return_val_if_fail(element && data, NULL);
+    g_return_val_if_fail (element && data, NULL);
 
     if (data->awaiting & IGNORE_TRANSACTIONS)
         /* Ignore them */
         return NULL;
 
 #ifdef AQBANKING6
-    if (!AB_ImExporterAccountInfo_GetFirstTransaction(element, AB_Transaction_TypeStatement, 0))
+    if (!AB_ImExporterAccountInfo_GetFirstTransaction (element, AB_Transaction_TypeStatement, 0))
 #else
-    if (!AB_ImExporterAccountInfo_GetFirstTransaction(element))
+    if (!AB_ImExporterAccountInfo_GetFirstTransaction (element))
 #endif
 /* No transaction found */
         return NULL;
@@ -933,7 +932,7 @@ txn_accountinfo_cb(AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data)
 
     if (!(data->awaiting & AWAIT_TRANSACTIONS))
     {
-        if (gnc_verify_dialog (GTK_WINDOW (data->parent), TRUE, "%s",
+        if (gnc_verify_dialog (GTK_WINDOW(data->parent), TRUE, "%s",
                               _("The bank has sent transaction information "
                                 "in its response."
                                 "\n"
@@ -949,7 +948,7 @@ txn_accountinfo_cb(AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data)
     }
 
     /* Lookup the corresponding gnucash account */
-    gnc_acc = gnc_ab_accinfo_to_gnc_acc(GTK_WIDGET(data->parent), element);
+    gnc_acc = gnc_ab_accinfo_to_gnc_acc (GTK_WIDGET(data->parent), element);
     if (!gnc_acc) return NULL;
     data->gnc_acc = gnc_acc;
 
@@ -957,13 +956,13 @@ txn_accountinfo_cb(AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data)
     {
         /* Retrieve the aqbanking account that belongs to this gnucash
          * account */
-        data->ab_acc = gnc_ab_get_ab_account(data->api, gnc_acc);
+        data->ab_acc = gnc_ab_get_ab_account (data->api, gnc_acc);
         if (!data->ab_acc)
         {
-            gnc_error_dialog(GTK_WINDOW (data->parent), "%s",
-                             _("No Online Banking account found for this "
-                               "gnucash account. These transactions will "
-                               "not be executed by Online Banking."));
+            gnc_error_dialog (GTK_WINDOW(data->parent), "%s",
+                              _("No Online Banking account found for this "
+                                "gnucash account. These transactions will "
+                                "not be executed by Online Banking."));
         }
     }
     else
@@ -973,33 +972,33 @@ txn_accountinfo_cb(AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data)
 
     if (!data->generic_importer)
     {
-        data->generic_importer = gnc_gen_trans_list_new(data->parent, NULL,
-                                 TRUE, 14, TRUE);
+        data->generic_importer = gnc_gen_trans_list_new (data->parent, NULL,
+                                                         TRUE, 14, TRUE);
         if (data->execute_txns)
         {
-            gnc_gen_trans_list_add_tp_cb(data->generic_importer,
-                                         gnc_ab_trans_processed_cb, data);
+            gnc_gen_trans_list_add_tp_cb (data->generic_importer,
+                                          gnc_ab_trans_processed_cb, data);
         }
     }
 
     /* Iterate through all transactions */
 #ifdef AQBANKING6
     {
-        AB_TRANSACTION_LIST *ab_trans_list = AB_ImExporterAccountInfo_GetTransactionList(element);
+        AB_TRANSACTION_LIST *ab_trans_list = AB_ImExporterAccountInfo_GetTransactionList (element);
         if (ab_trans_list)
-            AB_Transaction_List_ForEachByType(ab_trans_list,
-                                              txn_transaction_cb, data,
-                                              AB_Transaction_TypeStatement, 0);
+            AB_Transaction_List_ForEachByType (ab_trans_list,
+                                               txn_transaction_cb, data,
+                                               AB_Transaction_TypeStatement, 0);
     }
 #else
-    AB_ImExporterAccountInfo_TransactionsForEach(element, txn_transaction_cb,
-                                                 data);
+    AB_ImExporterAccountInfo_TransactionsForEach (element, txn_transaction_cb,
+                                                  data);
 #endif
     return NULL;
 }
 
 static AB_IMEXPORTER_ACCOUNTINFO *
-bal_accountinfo_cb(AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data)
+bal_accountinfo_cb (AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data)
 {
     GncABImExContextImport *data = user_data;
     Account *gnc_acc;
@@ -1014,16 +1013,16 @@ bal_accountinfo_cb(AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data)
     AB_ACCOUNT_STATUS *best = NULL;
 #endif
 
-    g_return_val_if_fail(element && data, NULL);
+    g_return_val_if_fail (element && data, NULL);
 
     if (data->awaiting & IGNORE_BALANCES)
         /* Ignore them */
         return NULL;
 
 #ifdef AQBANKING6
-    if (!AB_ImExporterAccountInfo_GetFirstBalance(element))
+    if (!AB_ImExporterAccountInfo_GetFirstBalance (element))
 #else
-    if (!AB_ImExporterAccountInfo_GetFirstAccountStatus(element))
+    if (!AB_ImExporterAccountInfo_GetFirstAccountStatus (element))
 #endif
         /* No balance found */
         return NULL;
@@ -1032,39 +1031,39 @@ bal_accountinfo_cb(AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data)
 
 #ifdef AQBANKING6
     /* Lookup the most recent BALANCE available */
-    booked_bal=AB_Balance_List_GetLatestByType(AB_ImExporterAccountInfo_GetBalanceList(element),
-                                               AB_Balance_TypeBooked);
+    booked_bal = AB_Balance_List_GetLatestByType (AB_ImExporterAccountInfo_GetBalanceList (element),
+                                                  AB_Balance_TypeBooked);
 #else
     {
         AB_ACCOUNT_STATUS *item = NULL;
         const GWEN_TIME *best_time = NULL;
         /* Lookup the most recent ACCOUNT_STATUS available */
-        item = AB_ImExporterAccountInfo_GetFirstAccountStatus(element);
+        item = AB_ImExporterAccountInfo_GetFirstAccountStatus (element);
         while (item)
         {
-            const GWEN_TIME *item_time = AB_AccountStatus_GetTime(item);
-            if (!best || GWEN_Time_Diff(best_time, item_time) < 0.0)
+            const GWEN_TIME *item_time = AB_AccountStatus_GetTime (item);
+            if (!best || GWEN_Time_Diff (best_time, item_time) < 0.0)
             {
                 best = item;
                 best_time = item_time;
             }
-            item = AB_ImExporterAccountInfo_GetNextAccountStatus(element);
+            item = AB_ImExporterAccountInfo_GetNextAccountStatus (element);
         }
 
-        booked_bal = AB_AccountStatus_GetBookedBalance(best);
+        booked_bal = AB_AccountStatus_GetBookedBalance (best);
     }
 #endif
 
     if (!(data->awaiting & AWAIT_BALANCES))
     {
          GtkWindow *parent = data->generic_importer ?
-              GTK_WINDOW(gnc_gen_trans_list_widget(data->generic_importer)) :
+              GTK_WINDOW(gnc_gen_trans_list_widget (data->generic_importer)) :
               GTK_WINDOW(data->parent);
          const char* balance_msg =
               _("The bank has sent balance information in its response.\n"
                 "Do you want to import it?");
         /* Ignore zero balances if we don't await a balance */
-        if (!booked_bal || AB_Value_IsZero(AB_Balance_GetValue(booked_bal)))
+        if (!booked_bal || AB_Value_IsZero (AB_Balance_GetValue (booked_bal)))
             return NULL;
 
         /* Ask the user whether to import unawaited non-zero balance */
@@ -1080,7 +1079,7 @@ bal_accountinfo_cb(AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data)
     }
 
     /* Lookup the corresponding gnucash account */
-    gnc_acc = gnc_ab_accinfo_to_gnc_acc(GTK_WIDGET (data->parent), element);
+    gnc_acc = gnc_ab_accinfo_to_gnc_acc (GTK_WIDGET(data->parent), element);
     if (!gnc_acc) return NULL;
     data->gnc_acc = gnc_acc;
 
@@ -1088,68 +1087,68 @@ bal_accountinfo_cb(AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data)
     if (booked_bal)
     {
 #ifdef AQBANKING6
-        const GWEN_DATE *ti = AB_Balance_GetDate(booked_bal);
+        const GWEN_DATE *ti = AB_Balance_GetDate (booked_bal);
 #else
-        const GNC_GWEN_DATE *ti = AB_Balance_GetTime(booked_bal);
+        const GNC_GWEN_DATE *ti = AB_Balance_GetTime (booked_bal);
 #endif
         if (ti)
         {
-            booked_tt = gnc_gwen_date_to_time64(ti);
+            booked_tt = gnc_gwen_date_to_time64 (ti);
         }
         else
         {
             /* No time found? Use today because the HBCI query asked for today's
              * balance. */
-            booked_tt = gnc_time64_get_day_neutral(gnc_time(NULL));
+            booked_tt = gnc_time64_get_day_neutral (gnc_time (NULL));
         }
-        booked_val = AB_Balance_GetValue(booked_bal);
+        booked_val = AB_Balance_GetValue (booked_bal);
         if (booked_val)
         {
-            booked_value = AB_Value_GetValueAsDouble(booked_val);
+            booked_value = AB_Value_GetValueAsDouble (booked_val);
         }
         else
         {
-            g_warning("bal_accountinfo_cb: booked_val == NULL.  Assuming 0");
+            g_warning ("bal_accountinfo_cb: booked_val == NULL.  Assuming 0");
             booked_value = 0.0;
         }
     }
     else
     {
-        g_warning("bal_accountinfo_cb: booked_bal == NULL.  Assuming 0");
+        g_warning ("bal_accountinfo_cb: booked_bal == NULL.  Assuming 0");
         booked_tt = 0;
         booked_value = 0.0;
     }
 
     /* Lookup noted balance */
 #ifdef AQBANKING6
-    noted_bal = AB_Balance_List_GetLatestByType(AB_ImExporterAccountInfo_GetBalanceList(element),
-                                                AB_Balance_TypeNoted);
+    noted_bal = AB_Balance_List_GetLatestByType (AB_ImExporterAccountInfo_GetBalanceList (element),
+                                                 AB_Balance_TypeNoted);
 #else
-    noted_bal = AB_AccountStatus_GetNotedBalance(best);
+    noted_bal = AB_AccountStatus_GetNotedBalance (best);
 #endif
     if (noted_bal)
     {
-        noted_val = AB_Balance_GetValue(noted_bal);
+        noted_val = AB_Balance_GetValue (noted_bal);
         if (noted_val)
-            noted_value = AB_Value_GetValueAsDouble(noted_val);
+            noted_value = AB_Value_GetValueAsDouble (noted_val);
         else
         {
-            g_warning("bal_accountinfo_cb: noted_val == NULL.  Assuming 0");
+            g_warning ("bal_accountinfo_cb: noted_val == NULL.  Assuming 0");
             noted_value = 0.0;
         }
     }
     else
     {
-        g_warning("bal_accountinfo_cb: noted_bal == NULL.  Assuming 0");
+        g_warning ("bal_accountinfo_cb: noted_bal == NULL.  Assuming 0");
         noted_value = 0.0;
     }
 
-    value = double_to_gnc_numeric(booked_value,
-                                  xaccAccountGetCommoditySCU(gnc_acc),
-                                  GNC_HOW_RND_ROUND_HALF_UP);
+    value = double_to_gnc_numeric (booked_value,
+                                   xaccAccountGetCommoditySCU (gnc_acc),
+                                   GNC_HOW_RND_ROUND_HALF_UP);
     if (noted_value == 0.0 && booked_value == 0.0)
     {
-        dialog = gtk_message_dialog_new(
+        dialog = gtk_message_dialog_new (
                      GTK_WINDOW(data->parent),
                      GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
                      GTK_MESSAGE_INFO,
@@ -1169,82 +1168,82 @@ bal_accountinfo_cb(AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data)
                        "Online Banking version number in the Online Banking "
                        "(AqBanking or HBCI) Setup. After that, try again to "
                        "download the Online Banking Balance."));
-        gtk_dialog_run(GTK_DIALOG(dialog));
-        gtk_widget_destroy(dialog);
+        gtk_dialog_run (GTK_DIALOG(dialog));
+        gtk_widget_destroy (dialog);
 
     }
     else
     {
-        gnc_numeric reconc_balance = xaccAccountGetReconciledBalance(gnc_acc);
+        gnc_numeric reconc_balance = xaccAccountGetReconciledBalance (gnc_acc);
 
-        gchar *booked_str = gnc_AB_VALUE_to_readable_string(booked_val);
-        gchar *message1 = g_strdup_printf(
+        gchar *booked_str = gnc_AB_VALUE_to_readable_string (booked_val);
+        gchar *message1 = g_strdup_printf (
                               _("Result of Online Banking job:\n"
                                 "Account booked balance is %s"),
                               booked_str);
         gchar *message2 =
             (noted_value == 0.0) ?
-            g_strdup("") :
-            g_strdup_printf(_("For your information: This account also "
-                              "has a noted balance of %s\n"),
-                            gnc_AB_VALUE_to_readable_string(noted_val));
+            g_strdup ("") :
+            g_strdup_printf (_("For your information: This account also "
+                               "has a noted balance of %s\n"),
+                             gnc_AB_VALUE_to_readable_string (noted_val));
 
-        if (gnc_numeric_equal(value, reconc_balance))
+        if (gnc_numeric_equal (value, reconc_balance))
         {
             const gchar *message3 =
                 _("The booked balance is identical to the current "
                   "reconciled balance of the account.");
-            dialog = gtk_message_dialog_new(
+            dialog = gtk_message_dialog_new (
                          GTK_WINDOW(data->parent),
                          GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
                          GTK_MESSAGE_INFO,
                          GTK_BUTTONS_OK,
                          "%s\n%s\n%s",
                          message1, message2, message3);
-            gtk_dialog_run(GTK_DIALOG(dialog));
-            gtk_widget_destroy(GTK_WIDGET(dialog));
+            gtk_dialog_run (GTK_DIALOG(dialog));
+            gtk_widget_destroy (GTK_WIDGET(dialog));
 
         }
         else
         {
             const char *message3 = _("Reconcile account now?");
 
-            show_recn_window = gnc_verify_dialog (GTK_WINDOW (data->parent), TRUE, "%s\n%s\n%s",
-                                                 message1, message2, message3);
+            show_recn_window = gnc_verify_dialog (GTK_WINDOW(data->parent), TRUE, "%s\n%s\n%s",
+                                                  message1, message2, message3);
         }
-        g_free(booked_str);
-        g_free(message1);
-        g_free(message2);
+        g_free (booked_str);
+        g_free (message1);
+        g_free (message2);
     }
 
     /* Show reconciliation window */
     if (show_recn_window)
-        recnWindowWithBalance(GTK_WIDGET (data->parent), gnc_acc, value, booked_tt);
+        recnWindowWithBalance (GTK_WIDGET(data->parent), gnc_acc, value, booked_tt);
 
     return NULL;
 }
 
 GncABImExContextImport *
-gnc_ab_import_context(AB_IMEXPORTER_CONTEXT *context,
-                      guint awaiting, gboolean execute_txns,
-                      AB_BANKING *api, GtkWidget *parent)
+gnc_ab_import_context (AB_IMEXPORTER_CONTEXT *context,
+                       guint awaiting, gboolean execute_txns,
+                       AB_BANKING *api, GtkWidget *parent)
 {
-    GncABImExContextImport *data = g_new(GncABImExContextImport, 1);
+    GncABImExContextImport *data = g_new (GncABImExContextImport, 1);
 #ifdef AQBANKING6
     AB_IMEXPORTER_ACCOUNTINFO_LIST *ab_ail;
 #endif
-    g_return_val_if_fail(context, NULL);
+    g_return_val_if_fail (context, NULL);
     /* Do not await and ignore at the same time */
-    g_return_val_if_fail(!(awaiting & AWAIT_BALANCES)
-                         || !(awaiting & IGNORE_BALANCES),
-                         NULL);
-    g_return_val_if_fail(!(awaiting & AWAIT_TRANSACTIONS)
-                         || !(awaiting & IGNORE_TRANSACTIONS),
-                         NULL);
+    g_return_val_if_fail (!(awaiting & AWAIT_BALANCES)
+                          || !(awaiting & IGNORE_BALANCES),
+                          NULL);
+    g_return_val_if_fail (!(awaiting & AWAIT_TRANSACTIONS)
+                          || !(awaiting & IGNORE_TRANSACTIONS),
+                          NULL);
     /* execute_txns must be FALSE if txns are not awaited */
-    g_return_val_if_fail(awaiting & AWAIT_TRANSACTIONS || !execute_txns, NULL);
+    g_return_val_if_fail (awaiting & AWAIT_TRANSACTIONS || !execute_txns, NULL);
     /* An api is needed for the jobs */
-    g_return_val_if_fail(!execute_txns || api, NULL);
+    g_return_val_if_fail (!execute_txns || api, NULL);
 
     data->awaiting = awaiting;
     data->txn_found = FALSE;
@@ -1252,65 +1251,69 @@ gnc_ab_import_context(AB_IMEXPORTER_CONTEXT *context,
     data->api = api;
     data->parent = parent;
 #ifdef AQBANKING6
-    data->job_list = AB_Transaction_List2_new();
+    data->job_list = AB_Transaction_List2_new ();
 #else
-    data->job_list = AB_Job_List2_new();
+    data->job_list = AB_Job_List2_new ();
 #endif
     data->tmp_job_list = NULL;
     data->generic_importer = NULL;
 
-    g_datalist_init(&data->tmp_job_list);
+    g_datalist_init (&data->tmp_job_list);
 
     /* Import transactions */
 #ifdef AQBANKING6
-    ab_ail = AB_ImExporterContext_GetAccountInfoList(context);
-    if (ab_ail && AB_ImExporterAccountInfo_List_GetCount(ab_ail))
+    ab_ail = AB_ImExporterContext_GetAccountInfoList (context);
+    if (ab_ail && AB_ImExporterAccountInfo_List_GetCount (ab_ail))
     {
         if (!(awaiting & IGNORE_TRANSACTIONS))
-            AB_ImExporterAccountInfo_List_ForEach(ab_ail, txn_accountinfo_cb,
-                                                  data);
+            AB_ImExporterAccountInfo_List_ForEach (ab_ail, 
+                                                   txn_accountinfo_cb,
+                                                   data);
 
         /* populate and display the matching window */
         if (data->generic_importer)
-            gnc_gen_trans_list_show_all(data->generic_importer);
+            gnc_gen_trans_list_show_all (data->generic_importer);
 
         /* Check balances */
         if (!(awaiting & IGNORE_BALANCES))
-            AB_ImExporterAccountInfo_List_ForEach(ab_ail, bal_accountinfo_cb,
-                                                  data);
+            AB_ImExporterAccountInfo_List_ForEach (ab_ail,
+                                                   bal_accountinfo_cb,
+                                                   data);
     }
 #else
     if (!(awaiting & IGNORE_TRANSACTIONS))
-        AB_ImExporterContext_AccountInfoForEach(context, txn_accountinfo_cb,
-                                                data);
+        AB_ImExporterContext_AccountInfoForEach (context,
+                                                 txn_accountinfo_cb,
+                                                 data);
 
     /* populate and display the matching window */
     if (data->generic_importer)
-        gnc_gen_trans_list_show_all(data->generic_importer);
+        gnc_gen_trans_list_show_all (data->generic_importer);
 
     /* Check balances */
     if (!(awaiting & IGNORE_BALANCES))
-        AB_ImExporterContext_AccountInfoForEach(context, bal_accountinfo_cb,
-                                                data);
+        AB_ImExporterContext_AccountInfoForEach (context,
+                                                 bal_accountinfo_cb,
+                                                 data);
 #endif
 
     /* Check bank-messages */
     {
-        AB_MESSAGE * bankmsg = AB_ImExporterContext_GetFirstMessage(context);
+        AB_MESSAGE * bankmsg = AB_ImExporterContext_GetFirstMessage (context);
         while (bankmsg)
         {
-            const char* subject = AB_Message_GetSubject(bankmsg);
-            const char* text = AB_Message_GetText(bankmsg);
-            gnc_info_dialog(GTK_WINDOW (data->parent), "%s\n%s %s\n%s",
-                            _("The bank has sent a message in its response."),
-                            _("Subject:"),
-                            subject,
-                            text);
+            const char* subject = AB_Message_GetSubject (bankmsg);
+            const char* text = AB_Message_GetText (bankmsg);
+            gnc_info_dialog (GTK_WINDOW(data->parent), "%s\n%s %s\n%s",
+                             _("The bank has sent a message in its response."),
+                             _("Subject:"),
+                             subject,
+                             text);
 
 #ifdef AQBANKING6
-            bankmsg = AB_Message_List_Next(bankmsg);
+            bankmsg = AB_Message_List_Next (bankmsg);
 #else
-            bankmsg = AB_ImExporterContext_GetNextMessage(context); // The iterator is incremented within aqbanking
+            bankmsg = AB_ImExporterContext_GetNextMessage (context); // The iterator is incremented within aqbanking
 #endif
         }
     }
@@ -1319,81 +1322,81 @@ gnc_ab_import_context(AB_IMEXPORTER_CONTEXT *context,
 }
 
 guint
-gnc_ab_ieci_get_found(GncABImExContextImport *ieci)
+gnc_ab_ieci_get_found (GncABImExContextImport *ieci)
 {
-    g_return_val_if_fail(ieci, 0);
+    g_return_val_if_fail (ieci, 0);
 
     return ieci->awaiting;
 }
 
 GNC_AB_JOB_LIST2 *
-gnc_ab_ieci_get_job_list(GncABImExContextImport *ieci)
+gnc_ab_ieci_get_job_list (GncABImExContextImport *ieci)
 {
-    g_return_val_if_fail(ieci, NULL);
+    g_return_val_if_fail (ieci, NULL);
 
     return ieci->job_list;
 }
 
 gboolean
-gnc_ab_ieci_run_matcher(GncABImExContextImport *ieci)
+gnc_ab_ieci_run_matcher (GncABImExContextImport *ieci)
 {
-    g_return_val_if_fail(ieci, FALSE);
+    g_return_val_if_fail (ieci, FALSE);
 
-    return gnc_gen_trans_list_run(ieci->generic_importer);
+    return gnc_gen_trans_list_run (ieci->generic_importer);
 }
 
 GWEN_DB_NODE *
-gnc_ab_get_permanent_certs(void)
+gnc_ab_get_permanent_certs (void)
 {
     int rv;
     GWEN_DB_NODE *perm_certs = NULL;
-    AB_BANKING *banking = gnc_AB_BANKING_new();
+    AB_BANKING *banking = gnc_AB_BANKING_new ();
 
-    g_return_val_if_fail(banking, NULL);
-    rv = AB_Banking_LoadSharedConfig(banking, "certs", &perm_certs);
-    gnc_AB_BANKING_fini(banking);
-    g_return_val_if_fail(rv >= 0, NULL);
+    g_return_val_if_fail (banking, NULL);
+    rv = AB_Banking_LoadSharedConfig (banking, "certs", &perm_certs);
+    gnc_AB_BANKING_fini (banking);
+    g_return_val_if_fail (rv >= 0, NULL);
     return perm_certs;
 }
 
 #if (AQBANKING_VERSION_INT >= 60400)
 GList*
-gnc_ab_trans_templ_list_new_from_ref_accounts(GNC_AB_ACCOUNT_SPEC *ab_acc)
+gnc_ab_trans_templ_list_new_from_ref_accounts (GNC_AB_ACCOUNT_SPEC *ab_acc)
 {
     GList *retval = NULL;
     AB_REFERENCE_ACCOUNT *ra;
     AB_REFERENCE_ACCOUNT_LIST *ral;
-    GWEN_BUFFER *accNameForTemplate = GWEN_Buffer_new(0,120,0,0);
-    gnc_numeric zero = gnc_numeric_zero();
+    GWEN_BUFFER *accNameForTemplate = GWEN_Buffer_new (0,120,0,0);
+    gnc_numeric zero = gnc_numeric_zero ();
 
     /* get the target account list */
-    ral = AB_AccountSpec_GetRefAccountList(ab_acc);
-    ra = AB_ReferenceAccount_List_First(ral);
-    
+    ral = AB_AccountSpec_GetRefAccountList (ab_acc);
+    ra = AB_ReferenceAccount_List_First (ral);
+
     /* fill the template list with the target accounts */
     while (ra)
     {
-        GncABTransTempl *new_templ = gnc_ab_trans_templ_new();
-        const char *iban = AB_ReferenceAccount_GetIban(ra);
-	const char *accName = AB_ReferenceAccount_GetAccountName(ra);
-	GWEN_Buffer_Reset(accNameForTemplate);
-	if (accName)
-	{
-	    GWEN_Buffer_AppendString(accNameForTemplate, accName);
-	    GWEN_Buffer_AppendString(accNameForTemplate, ": ");
-	}
-	GWEN_Buffer_AppendString(accNameForTemplate, iban);
-	gnc_ab_trans_templ_set_name(new_templ, GWEN_Buffer_GetStart(accNameForTemplate));
-	gnc_ab_trans_templ_set_recp_name(new_templ, AB_ReferenceAccount_GetOwnerName(ra));
-	gnc_ab_trans_templ_set_recp_account(new_templ, AB_ReferenceAccount_GetIban(ra));
-	gnc_ab_trans_templ_set_recp_bankcode(new_templ, AB_ReferenceAccount_GetBic(ra));
-	gnc_ab_trans_templ_set_amount(new_templ, zero);
-	retval = g_list_prepend (retval, new_templ);
-	ra = AB_ReferenceAccount_List_Next(ra);
+        GncABTransTempl *new_templ = gnc_ab_trans_templ_new ();
+        const char *iban = AB_ReferenceAccount_GetIban (ra);
+        const char *accName = AB_ReferenceAccount_GetAccountName (ra);
+        GWEN_Buffer_Reset (accNameForTemplate);
+        if (accName)
+        {
+            GWEN_Buffer_AppendString (accNameForTemplate, accName);
+            GWEN_Buffer_AppendString (accNameForTemplate, ": ");
+        }
+        GWEN_Buffer_AppendString (accNameForTemplate, iban);
+        gnc_ab_trans_templ_set_name (new_templ, GWEN_Buffer_GetStart (accNameForTemplate));
+        gnc_ab_trans_templ_set_recp_name (new_templ, AB_ReferenceAccount_GetOwnerName (ra));
+        gnc_ab_trans_templ_set_recp_account (new_templ, AB_ReferenceAccount_GetIban (ra));
+        gnc_ab_trans_templ_set_recp_bankcode (new_templ, AB_ReferenceAccount_GetBic (ra));
+        gnc_ab_trans_templ_set_amount (new_templ, zero);
+        retval = g_list_prepend (retval, new_templ);
+        ra = AB_ReferenceAccount_List_Next (ra);
     }
     retval = g_list_reverse (retval);
 
-    GWEN_Buffer_free(accNameForTemplate);
+    GWEN_Buffer_free (accNameForTemplate);
 
     return retval;
 }
diff --git a/gnucash/import-export/aqb/gnc-ab-utils.h b/gnucash/import-export/aqb/gnc-ab-utils.h
index bc9a3251c..f4f119f7b 100644
--- a/gnucash/import-export/aqb/gnc-ab-utils.h
+++ b/gnucash/import-export/aqb/gnc-ab-utils.h
@@ -94,12 +94,12 @@ typedef struct _GncABImExContextImport GncABImExContextImport;
  * Initialize the gwenhywfar library by calling GWEN_Init() and setting up
  * gwenhywfar logging.
  */
-void gnc_GWEN_Init(void);
+void gnc_GWEN_Init (void);
 
 /**
  * Finalize the gwenhywfar library.
  */
-void gnc_GWEN_Fini(void);
+void gnc_GWEN_Fini (void);
 
 /**
  * If there is a cached AB_BANKING object, return it initialized.  Otherwise,
@@ -108,7 +108,7 @@ void gnc_GWEN_Fini(void);
  *
  * @return The AB_BANKING object
  */
-AB_BANKING *gnc_AB_BANKING_new(void);
+AB_BANKING *gnc_AB_BANKING_new (void);
 
 /**
  * Delete the AB_BANKING @a api.  If this is also the one that was cached by
@@ -116,7 +116,7 @@ AB_BANKING *gnc_AB_BANKING_new(void);
  *
  * @param api AB_BANKING or NULL for the cached AB_BANKING object
  */
-void gnc_AB_BANKING_delete(AB_BANKING *api);
+void gnc_AB_BANKING_delete (AB_BANKING *api);
 
 /**
  * Finish the AB_BANKING @a api.  If this is also the one that was cached by
@@ -127,7 +127,7 @@ void gnc_AB_BANKING_delete(AB_BANKING *api);
  * @param api AB_BANKING object
  * @return Zero on success
  */
-gint gnc_AB_BANKING_fini(AB_BANKING *api);
+gint gnc_AB_BANKING_fini (AB_BANKING *api);
 
 /**
  * Get the corresponding AqBanking account to the GnuCash account @a gnc_acc.
@@ -138,7 +138,7 @@ gint gnc_AB_BANKING_fini(AB_BANKING *api);
  * @param gnc_acc The GnuCash account to query for GNC_AB_ACCOUNT_SPEC reference data
  * @return The GNC_AB_ACCOUNT_SPEC found or NULL otherwise
  */
-GNC_AB_ACCOUNT_SPEC *gnc_ab_get_ab_account(const AB_BANKING *api, Account *gnc_acc);
+GNC_AB_ACCOUNT_SPEC *gnc_ab_get_ab_account (const AB_BANKING *api, Account *gnc_acc);
 
 /**
  * Print the value of @a value with two decimal places and @a value's
@@ -147,7 +147,7 @@ GNC_AB_ACCOUNT_SPEC *gnc_ab_get_ab_account(const AB_BANKING *api, Account *gnc_a
  * @param value AB_VALUE or NULL
  * @return A newly allocated string
  */
-gchar *gnc_AB_VALUE_to_readable_string(const AB_VALUE *value);
+gchar *gnc_AB_VALUE_to_readable_string (const AB_VALUE *value);
 
 /**
  * Return the job as string.
@@ -155,7 +155,7 @@ gchar *gnc_AB_VALUE_to_readable_string(const AB_VALUE *value);
  * @param value GNC_AB_JOB or NULL
  * @return A newly allocated string
  */
-gchar *gnc_AB_JOB_to_readable_string(const GNC_AB_JOB *job);
+gchar *gnc_AB_JOB_to_readable_string (const GNC_AB_JOB *job);
 
 /**
  * Return the job_id as string.
@@ -163,7 +163,7 @@ gchar *gnc_AB_JOB_to_readable_string(const GNC_AB_JOB *job);
  * @param job_id
  * @return A newly allocated string
  */
-gchar *gnc_AB_JOB_ID_to_string(gulong job_id);
+gchar *gnc_AB_JOB_ID_to_string (gulong job_id);
 
 /**
  * Retrieve the merged "remote name" fields from a transaction.  The returned
@@ -173,7 +173,7 @@ gchar *gnc_AB_JOB_ID_to_string(gulong job_id);
  * @param ab_trans AqBanking transaction
  * @return A newly allocated string or NULL otherwise
  */
-gchar *gnc_ab_get_remote_name(const AB_TRANSACTION *ab_trans);
+gchar *gnc_ab_get_remote_name (const AB_TRANSACTION *ab_trans);
 
 /**
  * Retrieve the merged purpose fields from a transaction.  The returned string
@@ -183,7 +183,7 @@ gchar *gnc_ab_get_remote_name(const AB_TRANSACTION *ab_trans);
  * @param ab_trans AqBanking transaction
  * @return A newly allocated string, may be ""
  */
-gchar *gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans, gboolean is_ofx);
+gchar *gnc_ab_get_purpose (const AB_TRANSACTION *ab_trans, gboolean is_ofx);
 
 /**
  * Create the appropriate description field for a GnuCash Transaction by the
@@ -193,7 +193,7 @@ gchar *gnc_ab_get_purpose(const AB_TRANSACTION *ab_trans, gboolean is_ofx);
  * @param ab_trans AqBanking transaction
  * @return A newly allocated string, may be ""
  */
-gchar *gnc_ab_description_to_gnc(const AB_TRANSACTION *ab_trans, gboolean is_ofx);
+gchar *gnc_ab_description_to_gnc (const AB_TRANSACTION *ab_trans, gboolean is_ofx);
 
 /**
  * Create the appropriate memo field for a GnuCash Split by the information
@@ -203,7 +203,7 @@ gchar *gnc_ab_description_to_gnc(const AB_TRANSACTION *ab_trans, gboolean is_ofx
  * @param ab_trans AqBanking transaction
  * @return A newly allocated string, may be ""
  */
-gchar *gnc_ab_memo_to_gnc(const AB_TRANSACTION *ab_trans);
+gchar *gnc_ab_memo_to_gnc (const AB_TRANSACTION *ab_trans);
 
 /**
  * Create an unbalanced and dirty GnuCash transaction with a split to @a gnc_acc
@@ -213,7 +213,7 @@ gchar *gnc_ab_memo_to_gnc(const AB_TRANSACTION *ab_trans);
  * @param gnc_acc Account of to use for the split
  * @return A dirty GnuCash transaction or NULL otherwise
  */
-Transaction *gnc_ab_trans_to_gnc(const AB_TRANSACTION *ab_trans, Account *gnc_acc);
+Transaction *gnc_ab_trans_to_gnc (const AB_TRANSACTION *ab_trans, Account *gnc_acc);
 
 /**
  * Import balances and transactions found in a AB_IMEXPORTER_CONTEXT into
@@ -239,9 +239,11 @@ Transaction *gnc_ab_trans_to_gnc(const AB_TRANSACTION *ab_trans, Account *gnc_ac
  * gnc_ab_ieci_get_job_list() must be called and the result freed with
  * AB_Job_List2_FreeAll()
  */
-GncABImExContextImport *gnc_ab_import_context(
-    AB_IMEXPORTER_CONTEXT *context, guint awaiting, gboolean execute_txns,
-    AB_BANKING *api, GtkWidget *parent);
+GncABImExContextImport *gnc_ab_import_context (AB_IMEXPORTER_CONTEXT *context,
+                                               guint awaiting,
+                                               gboolean execute_txns,
+                                               AB_BANKING *api,
+                                               GtkWidget *parent);
 
 /**
  * Extract awaiting from @a data.
@@ -250,7 +252,7 @@ GncABImExContextImport *gnc_ab_import_context(
  * @return The initial awaiting bitmask plus IGNORE_* for unexpected and then
  * ignored items, and FOUND_* for non-empty items
  */
-guint gnc_ab_ieci_get_found(GncABImExContextImport *ieci);
+guint gnc_ab_ieci_get_found (GncABImExContextImport *ieci);
 
 /**
  * Extract the job list from @a data.
@@ -258,7 +260,7 @@ guint gnc_ab_ieci_get_found(GncABImExContextImport *ieci);
  * @param ieci The return value of gnc_ab_import_context()
  * @return The list of jobs, freeable with AB_Job_List2_FreeAll()
  */
-GNC_AB_JOB_LIST2 *gnc_ab_ieci_get_job_list(GncABImExContextImport *ieci);
+GNC_AB_JOB_LIST2 *gnc_ab_ieci_get_job_list (GncABImExContextImport *ieci);
 
 /**
  * Run the generic transaction matcher dialog.
@@ -266,7 +268,7 @@ GNC_AB_JOB_LIST2 *gnc_ab_ieci_get_job_list(GncABImExContextImport *ieci);
  * @param ieci The return value of gnc_ab_import_context()
  * @return The return value of gnc_gen_trans_list_run().
  */
-gboolean gnc_ab_ieci_run_matcher(GncABImExContextImport *ieci);
+gboolean gnc_ab_ieci_run_matcher (GncABImExContextImport *ieci);
 
 
 /**
@@ -274,7 +276,7 @@ gboolean gnc_ab_ieci_run_matcher(GncABImExContextImport *ieci);
  *
  * @return a GWEN_DB containing all permanently accepted SSL certificates (hashed).
  */
-GWEN_DB_NODE *gnc_ab_get_permanent_certs(void);
+GWEN_DB_NODE *gnc_ab_get_permanent_certs (void);
 
 /**
  * Creates an online ID from bank code and account number.
@@ -285,7 +287,7 @@ GWEN_DB_NODE *gnc_ab_get_permanent_certs(void);
  * @param accountnumber  Account number
  * @return an online ID
  */
-gchar* gnc_ab_create_online_id(const gchar *bankcode, const gchar *accountnumber);
+gchar* gnc_ab_create_online_id (const gchar *bankcode, const gchar *accountnumber);
 
 
 #if (AQBANKING_VERSION_INT >= 60400)
@@ -296,7 +298,7 @@ gchar* gnc_ab_create_online_id(const gchar *bankcode, const gchar *accountnumber
  * @return A GList of newly allocated GncABTransTempls
  */
 GList*
-gnc_ab_trans_templ_list_new_from_ref_accounts(GNC_AB_ACCOUNT_SPEC *ab_acc);
+gnc_ab_trans_templ_list_new_from_ref_accounts (GNC_AB_ACCOUNT_SPEC *ab_acc);
 #endif
 
 G_END_DECLS

commit edf000f4cf3d584ebdc833a4c2b31e663ee574d6
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Fri Jul 29 09:38:32 2022 +0100

    Fix uninstantiatable type error on the console
    
    sys:1: Warning: invalid uninstantiatable type '(null)' in cast to
    'GtkWindow'

diff --git a/gnucash/import-export/aqb/gnc-ab-utils.c b/gnucash/import-export/aqb/gnc-ab-utils.c
index f78585680..28e5b48e2 100644
--- a/gnucash/import-export/aqb/gnc-ab-utils.c
+++ b/gnucash/import-export/aqb/gnc-ab-utils.c
@@ -1058,7 +1058,7 @@ bal_accountinfo_cb(AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data)
     if (!(data->awaiting & AWAIT_BALANCES))
     {
          GtkWindow *parent = data->generic_importer ?
-              GTK_WINDOW(data->generic_importer) :
+              GTK_WINDOW(gnc_gen_trans_list_widget(data->generic_importer)) :
               GTK_WINDOW(data->parent);
          const char* balance_msg =
               _("The bank has sent balance information in its response.\n"



Summary of changes:
 gnucash/gnome-utils/gnc-main-window.c              |  84 ++-
 gnucash/gnome/dialog-report-style-sheet.c          |   2 -
 gnucash/gtkbuilder/assistant-qif-import.glade      |  16 -
 gnucash/gtkbuilder/dialog-report.glade             |   5 -
 gnucash/import-export/aqb/gnc-ab-utils.c           | 741 +++++++++++----------
 gnucash/import-export/aqb/gnc-ab-utils.h           |  48 +-
 .../import-export/qif-imp/assistant-qif-import.c   |   1 -
 7 files changed, 461 insertions(+), 436 deletions(-)



More information about the gnucash-changes mailing list