[Kst] Re: branches/work/kst/portto4/kst/src/libkstapp

Peter Kümmel syntheticpp at gmx.net
Mon Mar 21 21:05:31 CET 2011


On 21.03.2011 20:11, Barth Netterfield wrote:
> Arggg...
> It is implemented, but doesn't work.
>
> Here is why:
>    The output vectors get stored in a hash.
>    A Hash's order is undefined.
>    The names of the output vectors are written in the order of the hash.
>    The short name numbers are allocated in the order they are created
>    When creating the plugin in the first case, they are created in some
> order at the whim of the programmer (eg, in setupOutputs).
>    When creating the plugin when being loaded from file, they are
> created in the order they were listed in the file, which is different.
> Mehem ensues.
>
> It is possible that save/load used to work because QHash at one time
> might have kept the order of creation.  Or maybe it never worked.
>
> In any case, we need to fix it:
> options:
> a) change from QHash to QMap, and change setupOutputs in all plugins
> so things are created alphabetically (seems fragile)
> b) something less fragile that I can't think of off hand.
>
> I implemented (a) for unweighted linear fits and it does work.
>

What about this patch for (b) ? We don't have to touch any plugin code.

Seems to work with the polynominal fit.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ordered.patch
Type: text/x-patch
Size: 1247 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kst/attachments/20110321/708c86ef/attachment.patch 


More information about the Kst mailing list