I see that most qof_class_register calls set a NULL in place of the possible QofSetterFunc. I couldn't find a single (QofSetterFunc) with a grep of src/ but maybe that's just me.
I've got my own code to work when e.g. Account.c has a corresponding QofSetterFunc defined: { ACCOUNT_NAME_, QOF_TYPE_STRING, (QofAccessFunc)xaccAccountGetName, (QofSetterFunc) xaccAccountSetName }, I need a generic way of setting the updated and new data into the target book and this looks like a good candidate. (OK, new will need other code too). Was it an oversight not to specify QofSetterFunc's? Or just that nobody had a use for them, yet? I'm using: /* puts the list of object parameters into a suitable GSList* - mergeData->mergeObjectParams */ qof_class_param_foreach(rule->mergeType, gncBookMergeForeachParam, NULL); QofParam *holly; // test code, will be replaced later. char *lister; while(mergeData->mergeObjectParams != NULL) { holly = mergeData->mergeObjectParams->data; rule->mergeType = holly->param_type; void(*string_setter)(QofEntity*, QofType); if(safe_strcmp(rule->mergeType, QOF_TYPE_STRING) == 0) { lister = "testing again"; string_setter = (void(*)(QofEntity*, QofType))holly->param_setfcn; if(string_setter != NULL) { string_setter(mergeData->importEnt, lister); } } mergeData->mergeObjectParams = g_slist_next(mergeData->mergeObjectParams); } (Yes, I know I'm changing the setting in the import book - it was only a test.) Can I change each qof_class_register section to use appropriate Set functions, where they exist? (If they don't, I'll cross that bridge when I get to it!) (Can I have CVS commit access for the main tree too?) :-) Full source code and documentation, as usual: http://www.codehelp.co.uk/code/index.html -- Neil Williams ============= http://www.codehelp.co.uk/ http://www.dclug.org.uk/ http://www.isbn.org.uk/ http://sourceforge.net/projects/isbnsearch/ http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3
pgpzm8gXjbB9D.pgp
Description: signature
_______________________________________________ gnucash-devel mailing list [EMAIL PROTECTED] https://lists.gnucash.org/mailman/listinfo/gnucash-devel