From kmail-devel Fri Apr 27 11:58:28 2001 From: Don Sanders Date: Fri, 27 Apr 2001 11:58:28 +0000 To: kmail-devel Subject: Re: Question: Why does KMFilterActionMove::process() forKMMessage::parent() ? X-MARC-Message: https://marc.info/?l=kmail-devel&m=98837284031375 On Thursday 26 April 2001 19:57, Marc Mutz wrote: ... > Hmm, then checking for a parent is simply like an assert(), because > KMFilter::execActions() should check for the return code. AFAICS, there > are four of them > (used to be int's, now they will be enum): That's an improvement. > > -1 (GoOn): Everything is OK, the caller of > execActions() is still owner of the > message and you should continue applying > filter actions. > 0 (Finished): Everything is OK, but the caller of > execActions() is no longer owner. > Processing should stop here. > 1 (ErrorButGoOn): There was a small error (like invalid > parameter). Treated the same as GoOn. > 2 (CriticalError): There was a critical error (like "disk > full"). Processing should stop here. > > We could replace "if( msg-parent() ) return 0;" with "assert( > msg->parent() );". > If execActions() would properly check the ret.codes, the assert() would > never fire, no? > > Or is there more behind that? execActions does check the return code. I think execActions and the way it interacts with the various kmfilteractions has been carefully checked. Replace "if( msg->parent() ) return 0;" with "assert( msg->parent() );"? Are you talking about KMFilterActionMove::process? I don't think that's a good idea, it would stop other actions being applied to the message. Eg if 2 actions were defined 1) Move to folder x 2) Forward to foo@bar.com Then only the first action would be applied. Well there is still a problem in the current implementation where actions like set identity are applied but have no effect when in the list of actions the set identity action comes after a move action. BFN, Don. _______________________________________________ Kmail Developers mailing list Kmail@master.kde.org http://master.kde.org/mailman/listinfo/kmail