[kplato] Some code for KPTProject::getDuration()

John D Lamb kplato@kde.org
Tue, 28 Aug 2001 07:56:30 +0100


Thomas Zander wrote:
> 
> The checking-logic is good, but i don't think it belongs in the data model.
> The checking for the consitency of the data model should be on a heigher level,
> just below the GUI code.
> 
That sounds reasonable. The code is efficient but could cause delays
when the user enters a new relation if there are lots of relations.
Better to have separate checking code.
>
> What I would do is put the code in a (new) class that is created specially for
> creating new data structures.
> 
> I'll set up an stucture for that if you like.
>
Set up the structure and I'll write the check. 
>
> If we leave out the code to do the checking below, the method comes down to:
> 
> void KPTNode::addDependChildNode( KPTNode *node, ...
> Which is allready in CVS (just added a bugfix since it lacked the last line).

That looks as good a place as any.

I'll see if there's enough for me to write a more workable
getDuration().

PS I am assuming that if A and B are the two KPTNodes of a KPTRelation,
then A->m_parent == B->m_parent. Are you making the same assumption?

JDL