CLI undo edit?
Neil Williams
linux at codehelp.co.uk
Sat Aug 6 19:20:23 EDT 2005
On Sunday 07 August 2005 12:04 am, Neil Williams wrote:
> It may be handy to only store changes, but that means passing the parameter
> name into the instance_dirty routines (which will retrieve the value as a
> string).
>
> void qof_instance_make_dirty(QofInstance *inst, const char *param_name);
>
> (QOF can't undo / redo anything unless the data is accessible as a
> parameter with a QofAccessFunc *and* a QofSetterFunc so passing the value
> as a string is pointless. The combination of param_name and the object
> e_type from the instance do the rest.)
>
> I could do a qof_undo struct that contains the QofParam and a gpointer of
> the previous value of that parameter along with the type and GUID of the
> entity concerned?
Hmm, problem there. If the undo is recorded where the dirty flag is normally
set (after the edit), the previous value won't be available. Probably better
to put this into qof_begin_edit and get the parameter value there - before
the value is changed. Only changes that use begin_edit will therefore end up
in the undo / redo list - could provide some measure of control.
Maybe incorporate dirty instance flags into qof_commit_edit and have one less
call - it would set the QofCollection as dirty at the same time.
Are there times when a successful commit_edit should NOT lead to a dirty
instance flag?
(BTW. I'm using lowercase because the macros in qof-be-utils.h currently have
problems with the opaque structs when used from an external library and I'm
testing function versions - at least until the problem is solved.)
--
Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20050807/8b97b6ce/attachment.bin
More information about the gnucash-devel
mailing list