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

Christian Stimming stimming at tuhh.de
Tue Sep 26 03:51:28 EDT 2006

Hash: SHA1

Iff this change is okay for trunk, then IMHO it can very well be
back-ported completely. However, are you sure the problem is solved in
the optimum way by introducing a completely new QOF type? IMHO changes
like these

> Index: gnucash/trunk/lib/libqof/qof/qofquery.c
> ===================================================================
> --- gnucash/trunk/lib/libqof/qof/qofquery.c (revision 13747)
> +++ gnucash/trunk/lib/libqof/qof/qofquery.c (revision 14892)
> @@ -1694,5 +1694,6 @@
>      return;
>    }
> -  if (!safe_strcmp (pd->type_name, QOF_TYPE_STRING))
> +  if (!safe_strcmp (pd->type_name, QOF_TYPE_STRING) ||
> +      !safe_strcmp (pd->type_name, QOF_TYPE_NUMSTRING))
>    {
>      query_string_t pdata = (query_string_t) pd;

really suck. I readily admit I don't understand the QOF type system
anyway, but from a naive understanding of the term "type" I would expect
the sorting order *not* to be part of the definition of a type. And I
would additionally predict that the next time someone needs to write
strcmp(type_name, QOF_TYPE_STRING) somewhere, he/she will almost surely
forget to additionally check for QOF_TYPE_NUMSTRING. Wasn't there any
way to "only" change the sorting semantics as opposed to introducing a
new type?


Derek Atkins schrieb:
> I don't know if this changeset should get back-ported or not.
> What do you all think?
> Derek Atkins <warlord at cvs.gnucash.org> writes:
>> Author: warlord
>> Date: 2006-09-25 20:36:30 -0400 (Mon, 25 Sep 2006)
>> New Revision: 14892
>> Trac: http://svn.gnucash.org/trac/changeset/14892
>> Modified:
>>    gnucash/trunk/
> [snip]
>> Log:
>> 	  Add a new QOF_TYPE_NUMSTRING to add numeric sorts.  (#150799).
>> 	  This new type is like QOF_TYPE_STRING but it sorts numerically
>> 	  (first) and then sorts alphanumerically (by the tail of the
>> 	  number).  Added the QOF Type, the gnome-search support, and
>> 	  modified TRANS_NUM to use the new type.
> -derek
Version: GnuPG v1.4.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the gnucash-devel mailing list