Re: [Planner Dev] New undo patch: Link/unlink tasks



Hi!

El jue, 06-05-2004 a las 08:12, Richard Hult escribió:
> On ons, 2004-05-05 at 22:33 -0700, Chris Ladd wrote:
> > On Wed, 2004-05-05 at 23:01, Alvaro del Castillo wrote:
> > 
> > > Hmm, finally, after trying to remove the cmd->success field, I have
> > > found why I need it. If a command fails, I need to know why, and this is
> > > why we need the cmd->error string field.
> > > 
> > > But then, we can return NULL when a PlannerCmd fails because we can't
> > > access then to the cmd->error field :(
> > > 
> > > One solution could be to have a global last error field in
> > > PlannerCmdManager, but I don't like a lot the idea becasue we can have
> > > sync problems between several commands.
> > 
> > How about adding a GError **err to be passed into the PlannerCmd
> > creation function? Here is the documentation on it for quick reference: 
> > 
> > http://developer.gnome.org/doc/API/2.0/glib/glib-Error-Reporting.html
> > 
> > This framework seems nice and has most the work done for you already.
> 
> Exactly what I was about to suggest :)
> 

So when I do:

cmd = planner_task_tree_task_cmd_link (tree, task, target_task,
MRP_RELATION_FS, 0);

I need a way to recover the error. If cmd is NULL, the GError has to be
in the arguments list, so we need to modify all our undo/redo commands
to support a last arguments for a GError.

Is it ok for you?

Cheers




> /Richard

Attachment: signature.asc
Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]