backend config

Derek Atkins warlord at MIT.EDU
Thu Aug 18 08:51:18 EDT 2005


Quoting Neil Williams <linux at codehelp.co.uk>:

> Why const? The options aren't (yet) stored in the backend in a hash table but
> as discrete variables. The hash table is just a convenient way of passing a
> selection of keys and their values - I had first thought of actually doing it
> via a KvpFrame, but a hash table is more or less equivalent for this job and
> there's no need for the backend to store / write out the options themselves -
> that's done in the frontend, if at all, using e.g. GConf.

Why not const?

I was thinking that if the Backend Module *did* store its configuration in a
GHashTable, then it could just return a reference to that HashTable instead of
creating a new one to return.


>> Of course this means
>> you need some way to 'type' the configuration options.
>
> Now you've lost me. I was expecting the option list for each backend to be
> documented (e.g. Doxygen / man page) and only changeable at compile time. In
> effect, it becomes part of the API for the backend library. The backend would
> only act on those hash table keys that it recognised and only if the values
> are acceptable for those options.

g_hash_table_lookup(table, key) returns a gpointer..  To what do I cast this
gpointer in order to read the configuration option?  How do I do this
programatically?

Imagine a UI configuration dialog -- why should I need to write code in the UI
every time I add a new QofBackend module?  I'd rather write a generic
configuration dialog and be able to plugin the config options into the dialog
without requiring any new code in the UI.  This means I need to know the data
types.  This could be done via a secondary (xml) schema, or it can be done
in-band.

Each QOF parameter is typed (there's a "type" descriptor ;)
Perhaps using a one-level KVP _would_ be better than a raw GHashTable?  
Then you
could at least type the values.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available



More information about the gnucash-devel mailing list