version and version_check

Derek Atkins warlord at MIT.EDU
Sun Aug 15 11:38:55 EDT 2004


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

> Should version and version_check be compared/set in a merge?

_maybe_.  IIRC these are used for object versioining between the
engine and the backend.  So, I'm not sure exactly what a "merge" would
do to them.

> Various objects use these members in the structs, they can be merged using 
> QOF_TYPE_INT32 with no bother - question is, should they?

I've never heard of QOF_TYPE_INT32.  I don't think we have one, nor do
I think we should have one.  I can't imagine any user-servicible parts
that are only 32-bits wide.  We've got QOF_TYPE_NUMERIC for numeric
values and QOF_TYPE_INT64 for non-"numeric" numbers.

> I've got a complete list of current problems:
> In the table, when the specified object is merged, data in the specified 
> struct member variables will not be read, compared or set. Existing values in 
> the target QofBook will not be changed. Where the object is QOF compatible, 
> if the object is new (MERGE_NEW) the listed variable will be set to the 
> default value given in the table.
> http://www.codehelp.co.uk/code/problems.html#AEN378

Ok, so you're still not performing any compares..  Got it.

> gnc_commodity is a common thread and I'm looking at the KVP next to see if it 
> will help solve some other problems.

Yea, the commodity is sort of special-case at this point.

> I'm working on the business objects too, making them QOF compatible and I'll 
> post another table of the business objects discrepancies on the same page.

"making them qof compatible"???  They should've been nearly completely
QOF compatible..

> One solution I've used locally is to use QOF-compatible wrappers. e.g. for 
> functions that set or get enums, I'm using a gint wrapper:
> void gncBillTermSetType_q (GncBillTerm *term, gint type)
> {
> 	GncBillTermType q = type;
> 	if(!q) return;
> 	gncBillTermSetType(term, q);
> }
>
> Is this satisfactory? (Is it unnecessary?)

Yes, it is not necessary.  You can pass an int into an enum.

-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