gnucash upgrade from 2.2.9 to 2.3.14: AqBanking configfolderchanged

Bill Nottingham notting at redhat.com
Tue Aug 17 11:41:21 EDT 2010


Martin Preuss (aquamaniac at gmx.de) said: 
> On Dienstag 17 August 2010, Bill Nottingham wrote:
> [...]
> > What I discovered that appeared to happen (not on OSX) is that
> > the first time you run GnuCash compiled against the new aqbanking,
> > it creates enough of a stub config that the migration won't run. You
> > have to remove that stub, and *then* run 'aqbanking-cli updateconf'.
> [...]
> 
> Thats correct. The application is supposed to call the update/check function 
> before the first call to AB_Banking_Init() to possibly update an old 
> configuration.

Something like the attached? (warning: completely untested other than
'it builds')

Bill
-------------- next part --------------
diff -up gnucash-2.3.13/src/import-export/aqbanking/gnc-ab-utils.c.foo gnucash-2.3.13/src/import-export/aqbanking/gnc-ab-utils.c
--- gnucash-2.3.13/src/import-export/aqbanking/gnc-ab-utils.c.foo	2010-08-17 11:00:55.980535002 -0400
+++ gnucash-2.3.13/src/import-export/aqbanking/gnc-ab-utils.c	2010-08-17 11:08:54.822535006 -0400
@@ -134,6 +134,29 @@ gnc_AB_BANKING_new(void)
         api = AB_Banking_new("gnucash", NULL, 0);
         g_return_val_if_fail(api, NULL);
 
+#ifdef AQBANKING_VERSION_4_PLUS
+        /* Check for config migration */
+        if (AB_Banking_HasConf4(api, 0) != 0)
+        {
+            if (AB_Banking_HasConf3(api, 0) == 0)
+            {
+                g_message("gnc_AB_BANKING_new: importing aqbanking3 configuration\n");
+                if (AB_Banking_ImportConf3(api, 0) < 0)
+                {
+                    g_message("gnc_AB_BANKING_new: unable to import aqbanking3 configuration\n");
+                }
+            }
+            else if (AB_Banking_HasConf2(api, 0) == 0)
+            {
+                g_message("gnc_AB_BANKING_new: importing aqbanking2 configuration\n");
+                if (AB_Banking_ImportConf2(api, 0) < 0)
+                {
+                    g_message("gnc_AB_BANKING_new: unable to import aqbanking2 configuration\n");
+                }
+            }
+        } 
+#endif /* AQBANKING_VERSION_4_PLUS */        
+        
         /* Init the API */
         g_return_val_if_fail(AB_Banking_Init(api) == 0, NULL);
 


More information about the gnucash-devel mailing list