[Gnucash-changes] r13325 - gnucash/trunk/lib/libqof/qof - replacing gnc-event with qofevent

Josh Sled jsled at asynchronous.org
Tue Feb 21 11:33:35 EST 2006


On Mon, 2006-02-20 at 14:54 -0500, Neil Williams wrote:
> Deleted: gnucash/trunk/lib/libqof/qof/gnc-event.h
> ===================================================================
> --- gnucash/trunk/lib/libqof/qof/gnc-event.h	2006-02-20 19:50:42 UTC (rev 13324)
> +++ gnucash/trunk/lib/libqof/qof/gnc-event.h	2006-02-20 19:54:03 UTC (rev 13325)

> -typedef enum
> -{
> -  GNC_EVENT_NONE    = 0,
> -  GNC_EVENT_CREATE  = 1 << 0,
> -  GNC_EVENT_MODIFY  = 1 << 1,
> -  GNC_EVENT_DESTROY = 1 << 2,
> -  GNC_EVENT_ADD     = 1 << 3,
> -  GNC_EVENT_REMOVE  = 1 << 4,
> -  GNC_EVENT_ALL     = 0xff
> -} GNCEngineEventType;

> Copied: gnucash/trunk/lib/libqof/qof/qofevent.h (from rev 13311, gnucash/trunk/lib/libqof/qof/gnc-event.h)
> ===================================================================
> --- gnucash/trunk/lib/libqof/qof/gnc-event.h	2006-02-20 00:02:01 UTC (rev 13311)
> +++ gnucash/trunk/lib/libqof/qof/qofevent.h	2006-02-20 19:54:03 UTC (rev 13325)

> +These defaults merely replicate previous behaviour,
> +any process can define their own events. 
> +*/
> +#define QOF_EVENT_NONE     0
> +#define QOF_EVENT_CREATE   1
> +#define QOF_EVENT_MODIFY   2
> +#define QOF_EVENT_DESTROY  3
> +#define QOF_EVENT_ADD      4
> +#define QOF_EVENT_REMOVE   5
> +#define QOF_EVENT_ALL      6 /**< unused */

This is wrong; these are not equivalent in value.  While we don't appear
to generate multiple events at once in the app (I didn't look at all
uses, but most), we definitely register filters and test changes via
bit-masking.  These definitions don't allow that, and moreover cause
subtle bugs in the existing code.

I've fixed this in r13341 (and 13342).

-- 
...jsled
http://asynchronous.org/ - `a=jsled; b=asynchronous.org; echo ${a}@${b}`


More information about the gnucash-devel mailing list