(AUDIT?) Re: r14892 - gnucash/trunk - Add a new QOF_TYPE_NUMSTRING to add numeric sorts. (#150799).

Derek Atkins warlord at MIT.EDU
Tue Sep 26 09:24:44 EDT 2006


Quoting Christian Stimming <stimming at tuhh.de>:

> Okay. After your additional explanation I understand that either
> solution required a large invasive change. In that case we should
> probably just stick to the existing API and use your implementation

Well, I think we've already decided to fork the QOF API, so API Stability
isn't all that important.  Personally, I'm beginning to think that
option #2 is better than what I actually implemented..

>> 1) Add a new type, which keeps all the class definitions the same as
>>    they are (except changing TRANS_NUM from QOF_TYPE_STRING to
>>    QOF_TYPE_NUMSTRING).
>
> which is just what you did in r14892, right? The other solution sounds
> even more error-prone in terms of the number of places that need changes.

Yes.

>> 2) Add a new (optional) QofParam member of type QofSortFunc, modify
>>    each and every place where we define QofParam (which is every
>>    QofClass definition everywhere in GnuCash), and change the code to
>>    prefer a QofParam QofSortFunc over the default type QofSortFunc.
>>
>> I think both approaches are invasive.  The former is more "QOF API
>> friendly", the latter is probably "better" in that you can let each
>> parameter define its own sort function.
>
> I guess if we had some more object-oriented syntax avaible, it would
> have made some sense to define the TYPE_NUMSTRING as "a kind of"
> TYPE_STRING, i.e. define NUMSTRING as a subtype (inherited class) of
> STRING. But this is C and we have to stick with what we can write here.
> So eventually I think your implementation is just fine and I would agree
> to a back-port, too.

*nods*  But unfortunately we don't really have a class hierarchy.  :(

> Christian

-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