[Fwd: [Gnucash-changes] r13084 - gnucash/trunk - Fix overall
and ".log"-specific file-retention issues: Bug#329670 (++).]
Neil Williams
linux at codehelp.co.uk
Fri Feb 3 17:40:32 EST 2006
On Friday 03 February 2006 10:10 pm, Neil Williams wrote:
> On Friday 03 February 2006 2:32 am, Josh Sled wrote:
> > Hey Neil...
OK, after a second look:
This is what I think we should have instead of the change in qofsession.c:
(It's virtually identical, just that it only affects gnc-backend-file.)
Index: gnc-backend-file.c
=======================================
--- gnc-backend-file.c (revision 13089)
+++ gnc-backend-file.c (working copy)
@@ -963,6 +963,13 @@
be = (QofBackend*) gnc_be;
qof_backend_init(be);
+ /* Initialize be configuration. */
+ {
+ KvpFrame *config;
+ config = qof_backend_get_config(be);
+ qof_backend_load_config(be, config);
+ }
+
be->session_begin = file_session_begin;
be->session_end = file_session_end;
be->destroy_backend = file_destroy_backend;
Or we could simply not bother with the temporary frame and call the GConf
values directly, setting the data in the statics. Either way, a separate
KvpFrame is created when any function outside the backend actually ASKS for
the config options.
+ /* Initialize be configuration. */
+ {
+ file_retention_days = (int)gnc_gconf_get_float("general",
+ "retain_days", NULL);
+ file_compression = gnc_gconf_get_bool("general",
+ "file_compression", NULL);
+ }
+
Preferences?
The direct calls to GConf would appear adviseable.
gnc_backend_new is then called automatically by qofsession.c via
prov->backend_new()
> We can either setup the config KvpFrame directly in gnc_backend_new or
> simply set the existing statics to the GConf values when the backend is
> loaded. If we initialise the frame directly, we may not need the statics at
> all.
(Ignore that, we will need the statics - not that this is a problem.)
I'll commit when I've got the docs improved for both this and Chris' original
question about qoflog.c - probably tomorrow evening. (busy week)
--
Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20060203/d7addbb7/attachment.bin
More information about the gnucash-devel
mailing list