[Kst] Re: Patch in progress with some questions

Peter Kümmel syntheticpp at gmx.net
Sat Jan 8 12:25:31 CET 2011


On 07.01.2011 23:44, Nicolas Brisset wrote:
>>>> +#include "colorsequence.h"
>>>
>>> This files is missing in your patch.
>>
>> Found it, it's in libmath. I think I will move it
>> into libkst. Are there any reasons way it must stay
>> in libkstmath?
> I'm not familiar with the concept behind the splitting into libkst, libkstapp and libkstmath, but I don't see any reason why colorsequence should be in libkstmath.
> My feeling is that libkst shuold contain widgets/classes developed by kst and which have potential interest for other apps. I don't know whether that colorsequence stuff does. I'd say it's more libkstapp than libkst. But that's just my feeling, let's see what Barth says...
> 

We should only avaoid circular dependencies. Therefore I added a small interface for the
next() function, the only function used in libkst.

I also cleaned up a bit colorsequence by introducing ColorSequence::self().

As programming rule:
Heavily copy and pasting code, in your case

  if (!_self) {
    _self = new ColorSequence;
    qAddPostRoutine(ColorSequence::cleanup);
  }

is always a indicator that something went wrong, and
that there is a much better solution.

Peter



More information about the Kst mailing list